Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

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)]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #os #rust
ADD COMMENT
Topic
Name
9+3 =