Fix build errors: FTPS AsyncRead bridge, TLS connector type, unsafe env::set_var, dead code

Verified with cargo check + cargo run --example printer_polymorphism.
This commit is contained in:
2026-08-28 17:09:11 +00:00
parent 03bd07fbd7
commit 9b3815fd25
7 changed files with 27 additions and 23 deletions
+6 -1
View File
@@ -1,3 +1,5 @@
use std::time::Duration;
use tracing::info;
use super::{Printer, PrinterBase, PrinterError};
@@ -27,7 +29,10 @@ impl Printer for KlipperPrinter {
async fn connect(&mut self) -> Result<(), PrinterError> {
info!(printer = %self.base.id, host = %self.base.host, "probing Moonraker over HTTP");
reqwest::get(format!("http://{}/printer/info", self.base.host))
reqwest::Client::new()
.get(format!("http://{}/printer/info", self.base.host))
.timeout(Duration::from_secs(5))
.send()
.await
.and_then(|resp| resp.error_for_status())
.map_err(|err| PrinterError::Connection(self.base.id.clone(), err.to_string()))?;