@@ -38,20 +38,20 @@ mod my_mod {
38
38
// Functions declared using `pub(in path)` syntax are only visible
39
39
// within the given path. `path` must be a parent or ancestor module
40
40
pub(in crate::my_mod) fn public_function_in_my_mod() {
41
- print!("called `my_mod::nested::public_function_in_my_mod()`, that\n > ");
42
- public_function_in_nested()
41
+ print!("called `my_mod::nested::public_function_in_my_mod()`, that\n> ");
42
+ public_function_in_nested();
43
43
}
44
44
45
45
// Functions declared using `pub(self)` syntax are only visible within
46
46
// the current module, which is the same as leaving them private
47
47
pub(self) fn public_function_in_nested() {
48
- println!("called `my_mod::nested::public_function_in_nested");
48
+ println!("called `my_mod::nested::public_function_in_nested()` ");
49
49
}
50
50
51
51
// Functions declared using `pub(super)` syntax are only visible within
52
52
// the parent module
53
53
pub(super) fn public_function_in_super_mod() {
54
- println!("called my_mod::nested::public_function_in_super_mod");
54
+ println!("called ` my_mod::nested::public_function_in_super_mod()` ");
55
55
}
56
56
}
57
57
@@ -64,7 +64,7 @@ mod my_mod {
64
64
65
65
// pub(crate) makes functions visible only within the current crate
66
66
pub(crate) fn public_function_in_crate() {
67
- println!("called `my_mod::public_function_in_crate()");
67
+ println!("called `my_mod::public_function_in_crate()` ");
68
68
}
69
69
70
70
// Nested modules follow the same rules for visibility
0 commit comments