]> git.lizzy.rs Git - rust.git/blobdiff - src/doc/style/features/modules.md
Changed issue number to 36105
[rust.git] / src / doc / style / features / modules.md
index 23d8760f571f6cecca166e4d81d251e77169e335..995c5fda8a0aa65f123be724c1d0078567083e86 100644 (file)
@@ -17,12 +17,12 @@ Organize module headers as follows:
 Avoid using `#[path="..."]` directives; make the file system and
 module hierarchy match, instead.
 
-### Use the module hirearchy to organize APIs into coherent sections. [FIXME]
+### Use the module hierarchy to organize APIs into coherent sections. [FIXME]
 
 > **[FIXME]** Flesh this out with examples; explain what a "coherent
 > section" is with examples.
 >
-> The module hirearchy defines both the public and internal API of your module.
+> The module hierarchy defines both the public and internal API of your module.
 > Breaking related functionality into submodules makes it understandable to both
 > users and contributors to the module.
 
@@ -35,7 +35,7 @@ module hierarchy match, instead.
 For all except very short modules (<100 lines) and [tests](../testing/README.md),
 place the module `foo` in a separate file, as in:
 
-```rust
+```rust,ignore
 pub mod foo;
 
 // in foo.rs or foo/mod.rs
@@ -45,7 +45,7 @@ pub fn bar() { println!("..."); }
 
 rather than declaring it inline:
 
-```rust
+```rust,ignore
 pub mod foo {
     pub fn bar() { println!("..."); }
     /* ... */
@@ -67,7 +67,7 @@ On the other hand,
 [`io::net`](https://doc.rust-lang.org/std/io/net/)
 contains submodules, so it lives in a separate directory:
 
-```
+```text
 io/mod.rs
    io/extensions.rs
    io/fs.rs
@@ -82,7 +82,7 @@ io/mod.rs
 ```
 
 While it is possible to define all of `io` within a single directory,
-mirroring the module hirearchy in the directory structure makes
+mirroring the module hierarchy in the directory structure makes
 submodules of `io::net` easier to find.
 
 ### Consider top-level definitions or reexports. [FIXME: needs RFC]
@@ -104,13 +104,13 @@ while
 [`TcpStream`](https://doc.rust-lang.org/std/io/net/tcp/struct.TcpStream.html)
 is defined in `io/net/tcp.rs` and reexported in the `io` module.
 
-### Use internal module hirearchies for organization. [FIXME: needs RFC]
+### Use internal module hierarchies for organization. [FIXME: needs RFC]
 
 > **[FIXME]**
 > - Referencing internal modules from the standard library is subject to
 >   becoming outdated.
 
-Internal module hirearchies (i.e., private submodules) may be used to
+Internal module hierarchies (i.e., private submodules) may be used to
 hide implementation details that are not part of the module's API.
 
 For example, in [`std::io`](https://doc.rust-lang.org/std/io/), `mod mem`
@@ -120,7 +120,7 @@ and
 [`BufWriter`](https://doc.rust-lang.org/std/io/struct.BufWriter.html),
 but these are re-exported in `io/mod.rs` at the top level of the module:
 
-```rust
+```rust,ignore
 // libstd/io/mod.rs
 
 pub use self::mem::{MemReader, BufReader, MemWriter, BufWriter};