随笔:
fn function() { println!("function global"); } pub mod mod1 { pub fn function() { super::function(); println!("function mod1"); } pub mod mod2 { fn function() { println!("mod1::mod2::function"); } pub fn call() { self::function(); } } } fn main() { mod1::function(); mod1::mod2::call(); }
标签:function,mod1,mod2,self,pub,关键字,super,fn From: https://www.cnblogs.com/fanqshun/p/16974586.html