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:
@@ -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()))?;
|
||||
|
||||
Reference in New Issue
Block a user