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
+3 -15
View File
@@ -111,20 +111,8 @@ async fn main() -> anyhow::Result<()> {
Ok(())
}
/// Loads a `.env` file if present, without pulling in a heavyweight config
/// crate. No-op (and safe to ignore errors) when the file doesn't exist.
/// Loads `.env` if present; a missing file is fine (env vars may already be
/// set by the process supervisor), so the error is deliberately ignored.
fn dotenvy_load() {
if let Ok(contents) = std::fs::read_to_string(".env") {
for line in contents.lines() {
let line = line.trim();
if line.is_empty() || line.starts_with('#') {
continue;
}
if let Some((key, value)) = line.split_once('=') {
if std::env::var(key).is_err() {
std::env::set_var(key, value);
}
}
}
}
let _ = dotenvy::dotenv();
}