Answers for "how to check for os in rust"

0

how to check for os in rust

// rust programming language
if cfg!(windows) {
    println!("this is windows");
} else if cfg!(unix) {
    println!("this is unix alike");
}

//you can also use #[cfg(target_os="my_os")] or just #[cfg(my_os)]
Posted by: Guest on August-19-2020

Browse Popular Code Answers by Language