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