4
我有这个“main.rs”文件,我声明了一个版本常量。不同模块中的锈常数?
pub const VERSION: &'static str = "v2";
mod game;
fn main() {
do_stuff();
}
然后我想在不同的模块“game.rs”访问此全局常量:
pub fn do_stuff() {
println!("This is version: {}", VERSION);
}
怎样使恒随处可得?