rust的目录组织1
2023/05
13
15:05
main.rs
|__ [util] 目录
|__ mod.rs
|__ mathlib.rs
// mathlib.rs
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
// mod.rs
pub mod mathlib;
// main.rs
pub mod util;
use util::mathlib;
fn main() {
let c = mathlib::add(1, 2);
}
CopyRights: The Post by BY-NC-SA For Authorization,Original If Not Noted,Reprint Please Indicate From 老刘@开发笔记
Post Link: rust的目录组织1
Post Link: rust的目录组织1