How to find the current working directory in Rust

1 Answer

0 votes
use std::env;

fn main() {
    let dir = env::current_dir().unwrap();

    println!("{:?}", dir);
}


/*
run:

"/playground"

*/

 



answered Jun 3, 2025 by avibootz

Related questions

1 answer 216 views
1 answer 178 views
2 answers 139 views
1 answer 324 views
2 answers 237 views
1 answer 318 views
...