Skip to content

Commit

Permalink
Merge pull request #1220 from austinwk/fix_format_inconsistencies
Browse files Browse the repository at this point in the history
Fix minor formatting inconsistencies
  • Loading branch information
marioidival authored Jul 15, 2019
2 parents ff21dd4 + 97bbb59 commit c570783
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mod/visibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ mod my_mod {
// Functions declared using `pub(in path)` syntax are only visible
// within the given path. `path` must be a parent or ancestor module
pub(in crate::my_mod) fn public_function_in_my_mod() {
print!("called `my_mod::nested::public_function_in_my_mod()`, that\n > ");
public_function_in_nested()
print!("called `my_mod::nested::public_function_in_my_mod()`, that\n> ");
public_function_in_nested();
}
// Functions declared using `pub(self)` syntax are only visible within
// the current module, which is the same as leaving them private
pub(self) fn public_function_in_nested() {
println!("called `my_mod::nested::public_function_in_nested");
println!("called `my_mod::nested::public_function_in_nested()`");
}
// Functions declared using `pub(super)` syntax are only visible within
// the parent module
pub(super) fn public_function_in_super_mod() {
println!("called my_mod::nested::public_function_in_super_mod");
println!("called `my_mod::nested::public_function_in_super_mod()`");
}
}
Expand All @@ -64,7 +64,7 @@ mod my_mod {
// pub(crate) makes functions visible only within the current crate
pub(crate) fn public_function_in_crate() {
println!("called `my_mod::public_function_in_crate()");
println!("called `my_mod::public_function_in_crate()`");
}
// Nested modules follow the same rules for visibility
Expand Down

0 comments on commit c570783

Please sign in to comment.