Compare commits

..

No commits in common. "668a91941b01bbc13908311a5f6919970ae93819" and "b10fc3098480d23f585fc21e77bda8e59caa21c4" have entirely different histories.

8 changed files with 18 additions and 28 deletions

View File

@ -9,9 +9,7 @@ async fn main() {
let router = get_router(assets_path.as_path()); let router = get_router(assets_path.as_path());
// TODO: select port based on available port (or ask in CLI) // TODO: select port based on available port (or ask in CLI)
let listener = tokio::net::TcpListener::bind("localhost:3000") let listener = tokio::net::TcpListener::bind("localhost:3000").await.unwrap();
.await
.unwrap();
println!("Listening on: http://{}", listener.local_addr().unwrap()); println!("Listening on: http://{}", listener.local_addr().unwrap());
axum::serve(listener, router).await.unwrap(); axum::serve(listener, router).await.unwrap();
} }

View File

@ -7,4 +7,4 @@ struct CpsResponse;
pub async fn cps() -> impl IntoResponse { pub async fn cps() -> impl IntoResponse {
CpsResponse.into_response() CpsResponse.into_response()
} }

View File

@ -7,4 +7,4 @@ struct HomeResponse;
pub async fn home() -> impl IntoResponse { pub async fn home() -> impl IntoResponse {
HomeResponse.into_response() HomeResponse.into_response()
} }

View File

@ -7,4 +7,4 @@ pub fn get_routes() -> Router {
Router::new() Router::new()
.route("/home", routing::get(home::home)) .route("/home", routing::get(home::home))
.route("/cps", routing::get(cps::cps)) .route("/cps", routing::get(cps::cps))
} }

View File

@ -11,10 +11,10 @@ struct HelloResponse {
async fn hello() -> impl IntoResponse { async fn hello() -> impl IntoResponse {
HelloResponse { HelloResponse {
name: "Theo".to_string(), name: "Theo".to_string(),
} }.into_response()
.into_response()
} }
pub fn get_routes() -> Router { pub fn get_routes() -> Router {
Router::new().route("/", routing::get(hello)) Router::new()
.route("/", routing::get(hello))
} }

View File

@ -25,9 +25,7 @@ impl MenuResponse {
fn get_classes(&self, is_current_item: &bool) -> String { fn get_classes(&self, is_current_item: &bool) -> String {
let common_classes = match self.mobile { let common_classes = match self.mobile {
true => "block border-l-4 py-2 pl-3 pr-4 text-base font-medium".to_string(), true => "block border-l-4 py-2 pl-3 pr-4 text-base font-medium".to_string(),
false => { false => "inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium".to_string(),
"inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium".to_string()
}
}; };
match (self.mobile, is_current_item) { match (self.mobile, is_current_item) {
(true, true) => common_classes + " border-indigo-500 bg-indigo-50 text-indigo-700", (true, true) => common_classes + " border-indigo-500 bg-indigo-50 text-indigo-700",
@ -52,11 +50,11 @@ async fn menu(Query(params): Query<MenuParameters>) -> impl IntoResponse {
href: "/pages/cps".to_string(), href: "/pages/cps".to_string(),
current: false, current: false,
}, },
], ],
} }.into_response()
.into_response()
} }
pub fn get_routes() -> Router { pub fn get_routes() -> Router {
Router::new().route("/menu", routing::get(menu)) Router::new()
.route("/menu", routing::get(menu))
} }

View File

@ -56,10 +56,10 @@ async fn menu(Query(params): Query<MenuParameters>) -> impl IntoResponse {
current: false, current: false,
}, },
], ],
} }.into_response()
.into_response()
} }
pub fn get_routes() -> Router { pub fn get_routes() -> Router {
Router::new().route("/menu", routing::get(menu)) Router::new()
} .route("/menu", routing::get(menu))
}

View File

@ -16,10 +16,7 @@ fn main() {
// Add local lib directory to the linker search path (for def files and static libs) // Add local lib directory to the linker search path (for def files and static libs)
let static_lib_path = manifest_path.join("lib"); let static_lib_path = manifest_path.join("lib");
println!( println!("cargo::rustc-link-search=native={}", static_lib_path.display());
"cargo::rustc-link-search=native={}",
static_lib_path.display()
);
// Add the SESAM_FSV_LIB_PATH to the linker search path // Add the SESAM_FSV_LIB_PATH to the linker search path
let fsv_lib_path = PathBuf::from(env::var("SESAM_FSV_LIB_PATH").unwrap()); let fsv_lib_path = PathBuf::from(env::var("SESAM_FSV_LIB_PATH").unwrap());
@ -34,9 +31,6 @@ fn main() {
} }
// Link the SESAM_FSV_SSVLIB dynamic library // Link the SESAM_FSV_SSVLIB dynamic library
println!( println!("cargo::rustc-link-lib=dylib={}", env::var("SESAM_FSV_SSVLIB").unwrap());
"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` // TODO : try `raw-dylib` instead of `dylib` on Windows to avoid the need of the `lib` headers compiled from the `def`
} }