cargo-unmaintained 2.1.0

Find unmaintained packages in Rust projects
Documentation
use std::sync::atomic::AtomicBool;

pub static __NEED_NEWLINE: AtomicBool = AtomicBool::new(false);

macro_rules! __eprint {
    ($fmt:expr) => {
        if crate::opts::get().verbose {
            $crate::verbose::__NEED_NEWLINE.store(true, std::sync::atomic::Ordering::SeqCst);
            eprint!($fmt);
        }
    };
    ($fmt:expr, $($arg:tt)*) => {
        if crate::opts::get().verbose {
            $crate::verbose::__NEED_NEWLINE.store(true, std::sync::atomic::Ordering::SeqCst);
            eprint!($fmt, $($arg)*);
        }
    };
}

macro_rules! __eprintln {
    () => {
        if crate::opts::get().verbose {
            eprintln!();
            $crate::verbose::__NEED_NEWLINE.store(false, std::sync::atomic::Ordering::SeqCst);
        }
    };
    ($fmt:expr) => {
        if crate::opts::get().verbose {
            eprintln!($fmt);
            $crate::verbose::__NEED_NEWLINE.store(false, std::sync::atomic::Ordering::SeqCst);
        }
    };
    ($fmt:expr, $($arg:tt)*) => {
        if crate::opts::get().verbose {
            eprintln!($fmt, $($arg)*);
            $crate::verbose::__NEED_NEWLINE.store(false, std::sync::atomic::Ordering::SeqCst);
        }
    };
}

macro_rules! newline {
    () => {
        if $crate::verbose::__NEED_NEWLINE.load(std::sync::atomic::Ordering::SeqCst) {
            $crate::verbose::__eprintln!();
        }
    };
}

macro_rules! wrap {
    ($f:expr, $to_string:expr, $fmt:expr, $($arg:tt)*) => {{
        $crate::verbose::__eprint!(concat!($fmt, "..."), $($arg)*);
        #[allow(clippy::redundant_closure_call)]
        let result = $f();
        if let Ok(value) = &result {
            let s = $to_string(&value);
            $crate::verbose::__eprintln!("ok ({s})");
        } else {
            $crate::verbose::__eprintln!();
        }
        result
    }};
}

// smoelius: "The trick": https://stackoverflow.com/a/31749071
pub(crate) use {__eprint, __eprintln, newline, wrap};