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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pub mod sample_module {
pub fn public_fn_in_module(arg: i64) {
println!(
"called `sample_module::public_fn_in_module()`, arg: {}",
arg
);
}
}
pub fn public_function() {
println!("called `public_function()`");
}
#[allow(dead_code)]
fn private_function() {
println!("called `private_function()`",);
println!(
"called `private_function()` `private_function()` `private_function` \
`private_function()` `private_function()` `private_function()` \
`private_function()`"
);
}
pub mod another_mod;
pub mod sub_mod;
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
#[test]
fn access_to_child_mod() {
super::another_mod::pub_in_crate();
}
}