From 0eaf23873505c2595ed72a38f4be07be97c19a11 Mon Sep 17 00:00:00 2001 From: Simon C Date: Thu, 8 Aug 2024 15:01:28 +0200 Subject: [PATCH] style: Format code with fmt --- crates/app/src/main.rs | 4 +++- crates/app/src/pages/cps.rs | 2 +- crates/app/src/pages/home.rs | 2 +- crates/app/src/pages/mod.rs | 2 +- crates/app/src/templates/hello.rs | 6 +++--- crates/app/src/templates/nav.rs | 12 +++++++----- crates/app/src/templates/profile.rs | 8 ++++---- crates/sesam-vitale/build.rs | 10 ++++++++-- 8 files changed, 28 insertions(+), 18 deletions(-) diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 897ba73..b409b11 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -9,7 +9,9 @@ async fn main() { let router = get_router(assets_path.as_path()); // TODO: select port based on available port (or ask in CLI) - let listener = tokio::net::TcpListener::bind("localhost:3000").await.unwrap(); + let listener = tokio::net::TcpListener::bind("localhost:3000") + .await + .unwrap(); println!("Listening on: http://{}", listener.local_addr().unwrap()); axum::serve(listener, router).await.unwrap(); } diff --git a/crates/app/src/pages/cps.rs b/crates/app/src/pages/cps.rs index a4f378f..85c3f8a 100644 --- a/crates/app/src/pages/cps.rs +++ b/crates/app/src/pages/cps.rs @@ -7,4 +7,4 @@ struct CpsResponse; pub async fn cps() -> impl IntoResponse { CpsResponse.into_response() -} \ No newline at end of file +} diff --git a/crates/app/src/pages/home.rs b/crates/app/src/pages/home.rs index 4dd44e4..c2d9c91 100644 --- a/crates/app/src/pages/home.rs +++ b/crates/app/src/pages/home.rs @@ -7,4 +7,4 @@ struct HomeResponse; pub async fn home() -> impl IntoResponse { HomeResponse.into_response() -} \ No newline at end of file +} diff --git a/crates/app/src/pages/mod.rs b/crates/app/src/pages/mod.rs index 8113e8f..0580595 100644 --- a/crates/app/src/pages/mod.rs +++ b/crates/app/src/pages/mod.rs @@ -7,4 +7,4 @@ pub fn get_routes() -> Router { Router::new() .route("/home", routing::get(home::home)) .route("/cps", routing::get(cps::cps)) -} \ No newline at end of file +} diff --git a/crates/app/src/templates/hello.rs b/crates/app/src/templates/hello.rs index 20321a4..7c35118 100644 --- a/crates/app/src/templates/hello.rs +++ b/crates/app/src/templates/hello.rs @@ -11,10 +11,10 @@ struct HelloResponse { async fn hello() -> impl IntoResponse { HelloResponse { name: "Theo".to_string(), - }.into_response() + } + .into_response() } pub fn get_routes() -> Router { - Router::new() - .route("/", routing::get(hello)) + Router::new().route("/", routing::get(hello)) } diff --git a/crates/app/src/templates/nav.rs b/crates/app/src/templates/nav.rs index 8de2c76..e94dd0d 100644 --- a/crates/app/src/templates/nav.rs +++ b/crates/app/src/templates/nav.rs @@ -25,7 +25,9 @@ impl MenuResponse { fn get_classes(&self, is_current_item: &bool) -> String { let common_classes = match self.mobile { true => "block border-l-4 py-2 pl-3 pr-4 text-base font-medium".to_string(), - false => "inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium".to_string(), + false => { + "inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium".to_string() + } }; match (self.mobile, is_current_item) { (true, true) => common_classes + " border-indigo-500 bg-indigo-50 text-indigo-700", @@ -50,11 +52,11 @@ async fn menu(Query(params): Query) -> impl IntoResponse { href: "/pages/cps".to_string(), current: false, }, - ], - }.into_response() + ], + } + .into_response() } pub fn get_routes() -> Router { - Router::new() - .route("/menu", routing::get(menu)) + Router::new().route("/menu", routing::get(menu)) } diff --git a/crates/app/src/templates/profile.rs b/crates/app/src/templates/profile.rs index 4b1d186..3fc268f 100644 --- a/crates/app/src/templates/profile.rs +++ b/crates/app/src/templates/profile.rs @@ -56,10 +56,10 @@ async fn menu(Query(params): Query) -> impl IntoResponse { current: false, }, ], - }.into_response() + } + .into_response() } pub fn get_routes() -> Router { - Router::new() - .route("/menu", routing::get(menu)) -} \ No newline at end of file + Router::new().route("/menu", routing::get(menu)) +} diff --git a/crates/sesam-vitale/build.rs b/crates/sesam-vitale/build.rs index 60d9a3c..e0978ec 100644 --- a/crates/sesam-vitale/build.rs +++ b/crates/sesam-vitale/build.rs @@ -16,7 +16,10 @@ fn main() { // Add local lib directory to the linker search path (for def files and static libs) let static_lib_path = manifest_path.join("lib"); - println!("cargo::rustc-link-search=native={}", static_lib_path.display()); + println!( + "cargo::rustc-link-search=native={}", + static_lib_path.display() + ); // Add the SESAM_FSV_LIB_PATH to the linker search path let fsv_lib_path = PathBuf::from(env::var("SESAM_FSV_LIB_PATH").unwrap()); @@ -31,6 +34,9 @@ fn main() { } // Link the SESAM_FSV_SSVLIB dynamic library - println!("cargo::rustc-link-lib=dylib={}", env::var("SESAM_FSV_SSVLIB").unwrap()); + println!( + "cargo::rustc-link-lib=dylib={}", + env::var("SESAM_FSV_SSVLIB").unwrap() + ); // TODO : try `raw-dylib` instead of `dylib` on Windows to avoid the need of the `lib` headers compiled from the `def` } -- 2.45.2