feat: 模块系统 mod + pub — 多文件编译支持
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
mod math_mod;
|
||||
|
||||
fn main() -> i64 {
|
||||
let result = math_mod::add(3, 4);
|
||||
print_i64(result); // 7
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
pub fn add(a: i64, b: i64) -> i64 {
|
||||
return a + b;
|
||||
}
|
||||
Reference in New Issue
Block a user