mirror of
https://github.com/rust-lang/book.git
synced 2026-12-01 04:38:03 -06:00
rebuild pages at 7328b60
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
into other functions, both for re-use and for better organization. By splitting
|
||||
your code up into smaller chunks, each chunk is easier to understand on its
|
||||
own. But what happens if you find yourself with too many functions? Rust has a
|
||||
module system that handles the problem of wanting to to re-use code while
|
||||
module system that handles the problem of wanting to re-use code while
|
||||
keeping your code organized.</p>
|
||||
<p>In the same way that you extract lines of code into a function, you can extract
|
||||
functions (and other code like structs and enums too) into different modules. A
|
||||
|
||||
@@ -273,7 +273,7 @@ is allowed to access the <code>outermost</code> module since <code>outermost</co
|
||||
(root) module, as is <code>try_me</code>.</p>
|
||||
<p>The call to <code>outermost::middle_function</code> will work. This is because
|
||||
<code>middle_function</code> is public, and <code>try_me</code> is accessing <code>middle_function</code>
|
||||
through its parent module, <code>outermost</code> We determined in the previous paragraph
|
||||
through its parent module, <code>outermost</code>. We determined in the previous paragraph
|
||||
that this module is accessible.</p>
|
||||
<p>The call to <code>outermost::middle_secret_function</code> will cause a compilation error.
|
||||
<code>middle_secret_function</code> is private, so the second rule applies. The root
|
||||
|
||||
+2
-2
@@ -4703,7 +4703,7 @@ Rust's <em>modules</em>.</p>
|
||||
into other functions, both for re-use and for better organization. By splitting
|
||||
your code up into smaller chunks, each chunk is easier to understand on its
|
||||
own. But what happens if you find yourself with too many functions? Rust has a
|
||||
module system that handles the problem of wanting to to re-use code while
|
||||
module system that handles the problem of wanting to re-use code while
|
||||
keeping your code organized.</p>
|
||||
<p>In the same way that you extract lines of code into a function, you can extract
|
||||
functions (and other code like structs and enums too) into different modules. A
|
||||
@@ -5305,7 +5305,7 @@ is allowed to access the <code>outermost</code> module since <code>outermost</co
|
||||
(root) module, as is <code>try_me</code>.</p>
|
||||
<p>The call to <code>outermost::middle_function</code> will work. This is because
|
||||
<code>middle_function</code> is public, and <code>try_me</code> is accessing <code>middle_function</code>
|
||||
through its parent module, <code>outermost</code> We determined in the previous paragraph
|
||||
through its parent module, <code>outermost</code>. We determined in the previous paragraph
|
||||
that this module is accessible.</p>
|
||||
<p>The call to <code>outermost::middle_secret_function</code> will cause a compilation error.
|
||||
<code>middle_secret_function</code> is private, so the second rule applies. The root
|
||||
|
||||
Reference in New Issue
Block a user