1st edition: change either-or sequence for improved clarity

This commit is contained in:
Jay Strict 2017-04-05 15:15:11 +02:00
parent 75d4bc066c
commit 573222ed32
1 changed files with 16 additions and 11 deletions

View File

@ -176,23 +176,28 @@ mod english;
mod japanese;
```
These two declarations tell Rust to look for either `src/english.rs` and
`src/japanese.rs`, or `src/english/mod.rs` and `src/japanese/mod.rs`, depending
on our preference. In this case, because our modules have sub-modules, weve
chosen the second. Both `src/english/mod.rs` and `src/japanese/mod.rs` look
like this:
These two declarations tell Rust to look for
- either `src/english.rs` or `src/english/mod.rs`, and
- either `src/japanese.rs` or `src/japanese/mod.rs`,
depending on our preference. In this case, because our modules have sub-modules,
weve chosen the `mod.rs` approach. Both `src/english/mod.rs` and
`src/japanese/mod.rs` look like this:
```rust,ignore
mod greetings;
mod farewells;
```
Again, these declarations tell Rust to look for either
`src/english/greetings.rs`, `src/english/farewells.rs`,
`src/japanese/greetings.rs` and `src/japanese/farewells.rs` or
`src/english/greetings/mod.rs`, `src/english/farewells/mod.rs`,
`src/japanese/greetings/mod.rs` and
`src/japanese/farewells/mod.rs`. Because these sub-modules dont have
Again, these declarations tell Rust to look for
- `src/english/greetings.rs` or `src/english/greetings/mod.rs`,
- `src/english/farewells.rs` or `src/english/farewells/mod.rs`,
- `src/japanese/greetings.rs` or `src/japanese/greetings/mod.rs`,
- and `src/japanese/farewells.rs` or `src/japanese/farewells/mod.rs`.
Because these sub-modules dont have
their own sub-modules, weve chosen to make them
`src/english/greetings.rs`, `src/english/farewells.rs`,
`src/japanese/greetings.rs` and `src/japanese/farewells.rs`. Whew!