Eliah KaganThanks clippy7d66f9e1 year agoHistory
14 lines · 421 B · Rust
RawDownload
pub(super) mod function {    pub fn env() -> anyhow::Result<()> {        for (name, value) in std::env::vars_os() {            println!("{}={}", repr(&name), repr(&value));        }        Ok(())    }     fn repr(text: &std::ffi::OsStr) -> String {        text.to_str()            .filter(|s| !s.chars().any(|c| c == '"' || c == '\n'))            .map_or_else(|| format!("{text:?}"), ToOwned::to_owned)    }}