summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 9710430..f6ec659 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -17,13 +17,14 @@ async fn main() {
for printer in config.printers {
match printer {
- Printer::Prusa { name, host, api_key, .. } => {
+ Printer::Prusa { name, host, api_key } => {
+ println!("Found Prusa: {} at {}", name, host);
let state_clone = state.clone();
tokio::spawn(poll_prusa(name, host, api_key, state_clone));
}
Printer::Bambu { name, host, serial_number, access_code } => {
println!("Found Bambu: {} at {}", name, host);
- let state_clone = Arc::clone(&state);
+ let state_clone = state.clone();
tokio::spawn(poll_bambu(name, host, serial_number, access_code, state_clone));
}
}
@@ -33,7 +34,7 @@ async fn main() {
let app = Router::new()
.route("/", get(root))
- .with_state(Arc::clone(&state));
+ .with_state(state.clone());
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
let _ = axum::serve(listener, app).await;