Rules

  1. If a module named human has no submodules, you should put the declaration for the human in a file named human.rs
  2. If a module named human does have a submodule, you should put the declarations for human in a file named human/mod.rs

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
src/lib.rs
*/
pub mod Human;

/*
src/human/mod.rs
*/
pub mod social;
pub mod action;

/*
src/human/social.rs
*/
pub fn have_fun(){
	println!("Have fun");
}

/*
src/human/action.rs
*/
pub fn walk(){
	println!("walking");
}


/*
src/main.rs
*/
use my_project_name::human;

fn main(){
	human::social::have_fun();
	human::action::walk();
}