点击运行
use hello::rota::function as my_function; fn function() { println!("demo `function()`"); } mod hello { pub mod rota { pub fn function() { println!("demo `hello::rota`"); } } } fn main() { my_function(); println!("Coming"); { use crate::hello::rota::function; function(); println!("Returning"); } function(); }
运行结果 :
正在执行...