Skip to navigation
Rust environment variable as global constants
10.10.25
You can use rust environment variable as constant all over your app create a file .cargo/config.toml ```toml local_host = "127.0.0.1" local_user = "Foo" local_pass = "barbar" ``` ## in your app, access it with ``` println!("{}", env!("local_user")); ``` tags: rustconfig, rustenv
https://doc.rust-lang.org/cargo/reference/config.html
Reply
Anonymous
Information Epoch 1760439554
Make each program do one thing well.
Home
Notebook
Contact us