Reformat with the 2024 rustfmt style edition

This commit is contained in:
Joscha 2025-02-22 15:45:27 +01:00
parent debd3795e9
commit dfc22b0008
19 changed files with 32 additions and 33 deletions

View file

@ -1 +0,0 @@
style_edition = "2021"

View file

@ -2,7 +2,7 @@ use image::RgbaImage;
use palette::Srgba; use palette::Srgba;
use taffy::{AvailableSpace, NodeId, Point, Size, TaffyResult, TaffyTree}; use taffy::{AvailableSpace, NodeId, Point, Size, TaffyResult, TaffyTree};
use crate::{color, BoxedWidget, Rect, Vec2, View}; use crate::{BoxedWidget, Rect, Vec2, View, color};
fn point_to_vec2(point: Point<f32>) -> Vec2 { fn point_to_vec2(point: Point<f32>) -> Vec2 {
Vec2::new(point.x as i32, point.y as i32) Vec2::new(point.x as i32, point.y as i32)

View file

@ -1,7 +1,7 @@
use image::RgbaImage; use image::RgbaImage;
use palette::{blend::Compose, Srgba}; use palette::{Srgba, blend::Compose};
use crate::{color, Rect, Vec2}; use crate::{Rect, Vec2, color};
pub struct View<'a> { pub struct View<'a> {
area: Rect, area: Rect,

View file

@ -1,7 +1,7 @@
use palette::Srgba; use palette::Srgba;
use taffy::Layout; use taffy::Layout;
use crate::{color, Rect, Vec2, View, Widget}; use crate::{Rect, Vec2, View, Widget, color};
pub struct Block { pub struct Block {
border: Srgba, border: Srgba,

View file

@ -1,6 +1,6 @@
use image::{ use image::{
imageops::{self, FilterType},
RgbaImage, RgbaImage,
imageops::{self, FilterType},
}; };
use mark::dither::{AlgoFloydSteinberg, AlgoStucki, Algorithm, DiffEuclid, Palette}; use mark::dither::{AlgoFloydSteinberg, AlgoStucki, Algorithm, DiffEuclid, Palette};
use palette::{IntoColor, LinSrgb, Srgba}; use palette::{IntoColor, LinSrgb, Srgba};

View file

@ -2,11 +2,11 @@ use cosmic_text::{Attrs, AttrsOwned, Buffer, Family, FontSystem, Metrics, Shapin
use palette::Srgba; use palette::Srgba;
use showbits_assets::{UNIFONT, UNIFONT_JP, UNIFONT_NAME, UNIFONT_SIZE, UNIFONT_UPPER}; use showbits_assets::{UNIFONT, UNIFONT_JP, UNIFONT_NAME, UNIFONT_SIZE, UNIFONT_UPPER};
use taffy::{ use taffy::{
prelude::{AvailableSpace, Size},
Layout, Layout,
prelude::{AvailableSpace, Size},
}; };
use crate::{color, Rect, Vec2, View, Widget}; use crate::{Rect, Vec2, View, Widget, color};
// https://github.com/DioxusLabs/taffy/blob/main/examples/cosmic_text.rs // https://github.com/DioxusLabs/taffy/blob/main/examples/cosmic_text.rs

View file

@ -4,10 +4,11 @@ use anyhow::anyhow;
use comemo::Prehashed; use comemo::Prehashed;
use image::RgbaImage; use image::RgbaImage;
use taffy::{ use taffy::{
prelude::{AvailableSpace, Size},
Layout, Layout,
prelude::{AvailableSpace, Size},
}; };
use typst::{ use typst::{
Library, World,
diag::{FileError, FileResult}, diag::{FileError, FileResult},
eval::Tracer, eval::Tracer,
foundations::{Bytes, Datetime}, foundations::{Bytes, Datetime},
@ -15,7 +16,6 @@ use typst::{
syntax::{FileId, Source}, syntax::{FileId, Source},
text::{Font, FontBook}, text::{Font, FontBook},
visualize::Color, visualize::Color,
Library, World,
}; };
use crate::{View, Widget}; use crate::{View, Widget};

View file

@ -1,11 +1,11 @@
use showbits_common::{ use showbits_common::{
Node, Tree, WidgetExt,
color::{BLACK, WHITE}, color::{BLACK, WHITE},
widgets::{Block, Text}, widgets::{Block, Text},
Node, Tree, WidgetExt,
}; };
use taffy::{ use taffy::{
style_helpers::{length, percent, repeat},
AlignContent, AlignItems, Display, FlexDirection, AlignContent, AlignItems, Display, FlexDirection,
style_helpers::{length, percent, repeat},
}; };
use time::Date; use time::Date;

View file

@ -1,9 +1,9 @@
use image::{ use image::{
imageops::{self, FilterType},
Rgba, RgbaImage, Rgba, RgbaImage,
imageops::{self, FilterType},
}; };
use showbits_common::{color, widgets::Image, Node, Tree, WidgetExt}; use showbits_common::{Node, Tree, WidgetExt, color, widgets::Image};
use taffy::{style_helpers::percent, AlignItems, Display, FlexDirection}; use taffy::{AlignItems, Display, FlexDirection, style_helpers::percent};
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -1,11 +1,11 @@
use showbits_common::{ use showbits_common::{
Node, Tree, WidgetExt,
color::{BLACK, WHITE}, color::{BLACK, WHITE},
widgets::{Block, Text}, widgets::{Block, Text},
Node, Tree, WidgetExt,
}; };
use taffy::{ use taffy::{
style_helpers::{length, percent},
AlignItems, Display, FlexDirection, AlignItems, Display, FlexDirection,
style_helpers::{length, percent},
}; };
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -1,12 +1,12 @@
use image::{imageops, RgbaImage}; use image::{RgbaImage, imageops};
use rand::{seq::SliceRandom, Rng}; use rand::{Rng, seq::SliceRandom};
use showbits_assets::{EGG_BAD_COVERS, EGG_BAD_PATTERNS, EGG_COVERS, EGG_PATTERNS}; use showbits_assets::{EGG_BAD_COVERS, EGG_BAD_PATTERNS, EGG_COVERS, EGG_PATTERNS};
use showbits_common::{ use showbits_common::{
Node, Tree, WidgetExt,
color::{self, WHITE}, color::{self, WHITE},
widgets::{Image, Text}, widgets::{Image, Text},
Node, Tree, WidgetExt,
}; };
use taffy::{style_helpers::percent, AlignItems, Display, FlexDirection}; use taffy::{AlignItems, Display, FlexDirection, style_helpers::percent};
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -1,11 +1,11 @@
use image::RgbaImage; use image::RgbaImage;
use palette::{FromColor, IntoColor, LinLumaa}; use palette::{FromColor, IntoColor, LinLumaa};
use showbits_common::{ use showbits_common::{
Node, Tree, WidgetExt,
color::{self, BLACK, WHITE}, color::{self, BLACK, WHITE},
widgets::Image, widgets::Image,
Node, Tree, WidgetExt,
}; };
use taffy::{style_helpers::percent, AlignItems, Display, FlexDirection}; use taffy::{AlignItems, Display, FlexDirection, style_helpers::percent};
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -1,12 +1,12 @@
use image::{Luma, Pixel, RgbaImage}; use image::{Luma, Pixel, RgbaImage};
use showbits_common::{ use showbits_common::{
Node, Tree, WidgetExt,
color::{BLACK, WHITE}, color::{BLACK, WHITE},
widgets::{Image, Text}, widgets::{Image, Text},
Node, Tree, WidgetExt,
}; };
use taffy::{ use taffy::{
style_helpers::{length, percent},
AlignItems, Display, FlexDirection, AlignItems, Display, FlexDirection,
style_helpers::{length, percent},
}; };
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -1,4 +1,4 @@
use showbits_common::{color::WHITE, widgets::Text, Node, Tree, WidgetExt}; use showbits_common::{Node, Tree, WidgetExt, color::WHITE, widgets::Text};
use taffy::style_helpers::percent; use taffy::style_helpers::percent;
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -1,11 +1,11 @@
use showbits_common::{ use showbits_common::{
Node, Tree, WidgetExt,
color::{BLACK, WHITE}, color::{BLACK, WHITE},
widgets::{Block, Text}, widgets::{Block, Text},
Node, Tree, WidgetExt,
}; };
use taffy::{ use taffy::{
style_helpers::{length, percent, repeat},
AlignItems, Display, FlexDirection, AlignItems, Display, FlexDirection,
style_helpers::{length, percent, repeat},
}; };
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -1,4 +1,4 @@
use showbits_common::{color::WHITE, widgets::Typst, Node, Tree, WidgetExt}; use showbits_common::{Node, Tree, WidgetExt, color::WHITE, widgets::Typst};
use taffy::style_helpers::percent; use taffy::style_helpers::percent;
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -3,10 +3,10 @@ use std::path::PathBuf;
use escpos::{ use escpos::{
driver::FileDriver, driver::FileDriver,
printer::Printer as EPrinter, printer::Printer as EPrinter,
utils::{PageCode, Protocol, GS}, utils::{GS, PageCode, Protocol},
}; };
use image::{Rgba, RgbaImage}; use image::{Rgba, RgbaImage};
use showbits_common::{color, Tree}; use showbits_common::{Tree, color};
use taffy::{AvailableSpace, NodeId, Size}; use taffy::{AvailableSpace, NodeId, Size};
pub struct Printer { pub struct Printer {

View file

@ -3,11 +3,11 @@ mod r#static;
mod statuscode; mod statuscode;
use axum::{ use axum::{
Form, Router,
extract::{DefaultBodyLimit, Multipart, State}, extract::{DefaultBodyLimit, Multipart, State},
http::StatusCode, http::StatusCode,
response::{IntoResponse, Redirect, Response}, response::{IntoResponse, Redirect, Response},
routing::{get, post}, routing::{get, post},
Form, Router,
}; };
use serde::Deserialize; use serde::Deserialize;
use tokio::{net::TcpListener, sync::mpsc}; use tokio::{net::TcpListener, sync::mpsc};

View file

@ -1,5 +1,5 @@
use axum::{ use axum::{
http::{header, StatusCode, Uri}, http::{StatusCode, Uri, header},
response::{IntoResponse, Response}, response::{IntoResponse, Response},
}; };
use rust_embed::RustEmbed; use rust_embed::RustEmbed;