Skip to content

Commit e3170dd

Browse files
committed
updated comment to reflect feedback from mdinger on 2015dec24.
1 parent 7646c44 commit e3170dd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

text/0000-pub-restricted.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ within a submodule of the tree, then `X` *cannot* be put at the root
3636
of the module tree. Illustration:
3737

3838
```rust
39-
// Intent: `a` exports `I` and `foo`, but nothing else.
39+
// Intent: `a` exports `I`, `bar`, and `foo`, but nothing else.
4040
pub mod a {
4141
pub const I: i32 = 3;
4242

4343
// `semisecret` will be used "many" places within `a`, but
4444
// is not meant to be exposed outside of `a`.
4545
fn semisecret(x: i32) -> i32 { use self::b::c::J; x + J }
4646

47-
pub fn foo(y: i32) -> i32 { semisecret(I) + y }
4847
pub fn bar(z: i32) -> i32 { semisecret(I) * z }
48+
pub fn foo(y: i32) -> i32 { semisecret(I) + y }
4949

5050
mod b {
5151
mod c {
@@ -68,7 +68,7 @@ accessed within the items of `a`, and then re-exporting `semisecret`
6868
as necessary up the module tree.
6969

7070
```rust
71-
// Intent: `a` exports `I` and `foo`, but nothing else.
71+
// Intent: `a` exports `I`, `bar`, and `foo`, but nothing else.
7272
pub mod a {
7373
pub const I: i32 = 3;
7474

@@ -77,8 +77,8 @@ pub mod a {
7777
// (If we put `pub use` here, then *anyone* could access it.)
7878
use self::b::semisecret;
7979

80-
pub fn foo(y: i32) -> i32 { semisecret(I) + y }
8180
pub fn bar(z: i32) -> i32 { semisecret(I) * z }
81+
pub fn foo(y: i32) -> i32 { semisecret(I) + y }
8282

8383
mod b {
8484
pub use self::c::semisecret;
@@ -269,7 +269,7 @@ some manner.
269269
In the running example, one could instead write:
270270

271271
```rust
272-
// Intent: `a` exports `I` and `foo`, but nothing else.
272+
// Intent: `a` exports `I`, `bar`, and `foo`, but nothing else.
273273
pub mod a {
274274
pub const I: i32 = 3;
275275

@@ -278,8 +278,8 @@ pub mod a {
278278
// (`pub use` would be *rejected*; see Note 1 below)
279279
use self::b::semisecret;
280280

281-
pub fn foo(y: i32) -> i32 { semisecret(I) + y }
282281
pub fn bar(z: i32) -> i32 { semisecret(I) * z }
282+
pub fn foo(y: i32) -> i32 { semisecret(I) + y }
283283

284284
mod b {
285285
pub(a) use self::c::semisecret;

0 commit comments

Comments
 (0)