From 77b5c49da4d3ed4677c552a5ea5db32faa26b4d9 Mon Sep 17 00:00:00 2001
From: simonsan <14062932+simonsan@users.noreply.github.com>
Date: Mon, 18 Mar 2024 02:15:40 +0100
Subject: [PATCH] style: format the markdown and lint against it in ci to make
diffing easier and adopt a common style over the whole codebase
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
---
.dprint.json | 33 ++
.github/workflows/lint.yml | 14 +
CODE_OF_CONDUCT.md | 98 +++-
CONTRIBUTING.md | 37 +-
README.md | 31 +-
TRANSLATING.md | 36 +-
TRANSLATING_JA.md | 484 +++++++++---------
src/SUMMARY.md | 344 ++++++-------
src/attribute.md | 46 +-
src/attribute/cfg.md | 8 +-
src/attribute/crate.md | 4 +-
src/attribute/unused.md | 5 +-
src/cargo/build_scripts.md | 5 +-
src/cargo/deps.md | 22 +-
src/cargo/test.md | 24 +-
src/compatibility.md | 2 +-
src/compatibility/raw_identifiers.md | 14 +-
src/conversion.md | 9 +-
src/conversion/from_into.md | 6 +-
src/conversion/string.md | 10 +-
src/crates/lib.md | 8 +-
src/crates/using_lib.md | 2 +-
src/custom_types.md | 6 +-
src/custom_types/constants.md | 11 +-
src/custom_types/enum.md | 17 +-
src/custom_types/enum/enum_use.md | 2 +-
src/custom_types/structs.md | 9 +-
src/error.md | 33 +-
src/error/abort_unwind.md | 15 +-
src/error/iter_result.md | 9 +-
src/error/multiple_error_types.md | 11 +-
.../multiple_error_types/boxing_errors.md | 6 +-
.../multiple_error_types/define_error_type.md | 20 +-
.../multiple_error_types/option_result.md | 4 +-
.../reenter_question_mark.md | 32 +-
src/error/multiple_error_types/wrap_error.md | 1 -
src/error/option_unwrap.md | 24 +-
src/error/option_unwrap/and_then.md | 22 +-
src/error/option_unwrap/defaults.md | 37 +-
src/error/option_unwrap/map.md | 16 +-
src/error/panic.md | 9 +-
src/error/result.md | 31 +-
src/error/result/early_returns.md | 20 +-
src/error/result/enter_question_mark.md | 18 +-
src/error/result/result_alias.md | 16 +-
src/error/result/result_map.md | 4 +-
src/expression.md | 10 +-
src/flow_control/for.md | 17 +-
src/flow_control/if_else.md | 4 +-
src/flow_control/if_let.md | 10 +-
src/flow_control/let_else.md | 14 +-
src/flow_control/loop.md | 2 +-
src/flow_control/match.md | 4 +-
src/flow_control/match/binding.md | 5 +-
src/flow_control/match/destructuring.md | 11 +-
.../destructuring/destructure_pointers.md | 10 +-
.../match/destructuring/destructure_slice.md | 3 +-
src/flow_control/match/guard.md | 7 +-
src/flow_control/while_let.md | 4 +-
src/fn.md | 10 +-
src/fn/closures.md | 19 +-
src/fn/closures/anonymity.md | 18 +-
src/fn/closures/capture.md | 18 +-
src/fn/closures/closure_examples.md | 2 +-
src/fn/closures/closure_examples/iter_any.md | 5 +-
src/fn/closures/closure_examples/iter_find.md | 10 +-
src/fn/closures/input_functions.md | 10 +-
src/fn/closures/input_parameters.md | 37 +-
src/fn/closures/output_parameters.md | 13 +-
src/fn/diverging.md | 10 +-
src/fn/hof.md | 11 +-
src/fn/methods.md | 4 +-
src/generics.md | 18 +-
src/generics/assoc_items.md | 10 +-
src/generics/assoc_items/the_problem.md | 12 +-
src/generics/assoc_items/types.md | 10 +-
src/generics/bounds.md | 14 +-
src/generics/bounds/testcase_empty.md | 6 +-
src/generics/gen_fn.md | 12 +-
src/generics/impl.md | 1 -
src/generics/multi_bounds.md | 4 +-
src/generics/new_types.md | 16 +-
src/generics/phantom.md | 15 +-
src/generics/phantom/testcase_units.md | 8 +-
src/generics/where.md | 14 +-
src/hello.md | 7 +-
src/hello/comment.md | 17 +-
src/hello/print.md | 37 +-
src/hello/print/fmt.md | 16 +-
src/hello/print/print_debug.md | 15 +-
src/hello/print/print_display.md | 32 +-
.../print/print_display/testcase_list.md | 7 +-
src/index.md | 51 +-
src/macros/designators.md | 22 +-
src/macros/dsl.md | 16 +-
src/macros/overload.md | 6 +-
src/macros/repeat.md | 12 +-
src/macros/syntax.md | 4 +-
src/macros/variadics.md | 2 +-
src/meta.md | 10 +-
src/meta/doc.md | 12 +-
src/meta/playground.md | 4 +-
src/mod.md | 2 +-
src/mod/split.md | 1 -
src/mod/struct_visibility.md | 8 +-
src/mod/super.md | 4 +-
src/primitives.md | 16 +-
src/primitives/literals.md | 6 +-
src/scope.md | 6 +-
src/scope/borrow.md | 12 +-
src/scope/borrow/mut.md | 9 +-
src/scope/borrow/ref.md | 4 +-
src/scope/lifetime.md | 12 +-
src/scope/lifetime/elision.md | 7 +-
src/scope/lifetime/explicit.md | 18 +-
src/scope/lifetime/fn.md | 15 +-
src/scope/lifetime/lifetime_bounds.md | 10 +-
src/scope/lifetime/lifetime_coercion.md | 9 +-
src/scope/lifetime/static_lifetime.md | 35 +-
src/scope/lifetime/struct.md | 1 -
src/scope/lifetime/trait.md | 1 -
src/scope/move.md | 11 +-
src/scope/move/mut.md | 2 +-
src/scope/move/partial_move.md | 26 +-
src/scope/raii.md | 2 +
src/std.md | 14 +-
src/std/arc.md | 4 +-
src/std/box.md | 4 +-
src/std/hash.md | 21 +-
src/std/hash/alt_key_types.md | 34 +-
src/std/hash/hashset.md | 30 +-
src/std/option.md | 8 +-
src/std/panic.md | 8 +-
src/std/rc.md | 12 +-
src/std/result.md | 8 +-
src/std/result/question_mark.md | 10 +-
src/std/str.md | 48 +-
src/std/vec.md | 14 +-
src/std_misc.md | 9 +-
src/std_misc/arg.md | 4 +-
src/std_misc/arg/matching.md | 4 +-
src/std_misc/channels.md | 4 +-
src/std_misc/file.md | 4 +-
src/std_misc/file/create.md | 5 +-
src/std_misc/file/open.md | 7 +-
src/std_misc/file/read_lines.md | 32 +-
src/std_misc/fs.md | 1 -
src/std_misc/path.md | 9 +-
src/std_misc/process.md | 4 +-
src/std_misc/threads/testcase_mapreduce.md | 66 +--
src/testing.md | 12 +-
src/testing/dev_dependencies.md | 10 +-
src/testing/doc_testing.md | 22 +-
src/testing/integration_testing.md | 6 +-
src/testing/unit_testing.md | 19 +-
src/trait.md | 11 +-
src/trait/clone.md | 8 +-
src/trait/derive.md | 22 +-
src/trait/disambiguating.md | 8 +-
src/trait/drop.md | 8 +-
src/trait/dyn.md | 23 +-
src/trait/impl_trait.md | 25 +-
src/trait/iter.md | 10 +-
src/trait/ops.md | 16 +-
src/types.md | 9 +-
src/types/alias.md | 4 +-
src/types/inference.md | 8 +-
src/types/literals.md | 13 +-
src/unsafe.md | 28 +-
src/unsafe/asm.md | 299 +++++++----
src/variable_bindings.md | 6 +-
src/variable_bindings/freeze.md | 4 +-
src/variable_bindings/mut.md | 4 +-
src/variable_bindings/scope.md | 6 +-
174 files changed, 1868 insertions(+), 1587 deletions(-)
create mode 100644 .dprint.json
create mode 100644 .github/workflows/lint.yml
diff --git a/.dprint.json b/.dprint.json
new file mode 100644
index 0000000000..44cf571108
--- /dev/null
+++ b/.dprint.json
@@ -0,0 +1,33 @@
+{
+ "lineWidth": 80,
+ "markdown": {
+ "lineWidth": 80,
+ "emphasisKind": "asterisks",
+ "strongKind": "asterisks",
+ "textWrap": "always"
+ },
+ "toml": {
+ "lineWidth": 80
+ },
+ "json": {
+ "lineWidth": 80,
+ "indentWidth": 4
+ },
+ "includes": [
+ "**/*.{md}",
+ "**/*.{toml}",
+ "**/*.{json}",
+ "**/*.{js,ts,tsx,jsx}"
+ ],
+ "excludes": [
+ "book/**/book.js",
+ "theme/book.js",
+ "target/**/*"
+ ],
+ "plugins": [
+ "https://plugins.dprint.dev/markdown-0.16.4.wasm",
+ "https://plugins.dprint.dev/toml-0.6.1.wasm",
+ "https://plugins.dprint.dev/json-0.19.2.wasm",
+ "https://plugins.dprint.dev/typescript-0.89.3.wasm"
+ ]
+}
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000000..af919d00bd
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,14 @@
+name: Lint with dprint
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+
+jobs:
+ style:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: dprint/check@v2.2
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index cdfd7cfe80..9440d6a133 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -1,39 +1,95 @@
# The Rust Code of Conduct
-A version of this document [can be found online](https://www.rust-lang.org/conduct.html).
+A version of this document
+[can be found online](https://www.rust-lang.org/conduct.html).
## Conduct
**Contact**: [rust-mods@rust-lang.org](mailto:rust-mods@rust-lang.org)
-* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
-* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
-* Please be kind and courteous. There's no need to be mean or rude.
-* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
-* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
-* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
-* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Rust moderation team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
-* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
+- We are committed to providing a friendly, safe and welcoming environment for
+ all, regardless of level of experience, gender identity and expression, sexual
+ orientation, disability, personal appearance, body size, race, ethnicity, age,
+ religion, nationality, or other similar characteristic.
+- On IRC, please avoid using overtly sexual nicknames or other nicknames that
+ might detract from a friendly, safe and welcoming environment for all.
+- Please be kind and courteous. There's no need to be mean or rude.
+- Respect that people have differences of opinion and that every design or
+ implementation choice carries a trade-off and numerous costs. There is seldom
+ a right answer.
+- Please keep unstructured critique to a minimum. If you have solid ideas you
+ want to experiment with, make a fork and see how it works.
+- We will exclude you from interaction if you insult, demean or harass anyone.
+ That is not welcome behavior. We interpret the term "harassment" as including
+ the definition in the
+ [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any
+ lack of clarity about what might be included in that concept, please read
+ their definition. In particular, we don't tolerate behavior that excludes
+ people in socially marginalized groups.
+- Private harassment is also unacceptable. No matter who you are, if you feel
+ you have been or are being harassed or made uncomfortable by a community
+ member, please contact one of the channel ops or any of the
+ [Rust moderation team][mod_team] immediately. Whether you're a regular
+ contributor or a newcomer, we care about making this community a safe place
+ for you and we've got your back.
+- Likewise any spamming, trolling, flaming, baiting or other attention-stealing
+ behavior is not welcome.
## Moderation
-These are the policies for upholding our community's standards of conduct. If you feel that a thread needs moderation, please contact the [Rust moderation team][mod_team].
+These are the policies for upholding our community's standards of conduct. If
+you feel that a thread needs moderation, please contact the
+[Rust moderation team][mod_team].
-1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
-2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
+1. Remarks that violate the Rust standards of conduct, including hateful,
+ hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is
+ allowed, but never targeting another user, and never in a hateful manner.)
+2. Remarks that moderators find inappropriate, whether listed in the code of
+ conduct or not, are also not allowed.
3. Moderators will first respond to such remarks with a warning.
-4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of the communication channel to cool off.
-5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
-6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology.
-7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, **in private**. Complaints about bans in-channel are not allowed.
-8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.
+4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of
+ the communication channel to cool off.
+5. If the user comes back and continues to make trouble, they will be banned,
+ i.e., indefinitely excluded.
+6. Moderators may choose at their discretion to un-ban the user if it was a
+ first offense and they offer the offended party a genuine apology.
+7. If a moderator bans someone and you think it was unjustified, please take it
+ up with that moderator, or with a different moderator, **in private**.
+ Complaints about bans in-channel are not allowed.
+8. Moderators are held to a higher standard than other community members. If a
+ moderator creates an inappropriate situation, they should expect less leeway
+ than others.
-In the Rust community we strive to go the extra step to look out for each other. Don't just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they're off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
+In the Rust community we strive to go the extra step to look out for each other.
+Don't just aim to be technically unimpeachable, try to be your best self. In
+particular, avoid flirting with offensive or sensitive issues, particularly if
+they're off-topic; this all too often leads to unnecessary fights, hurt
+feelings, and damaged trust; worse, it can drive people away from the community
+entirely.
-And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
+And if someone takes issue with something you said or did, resist the urge to be
+defensive. Just stop doing what it was they complained about and apologize. Even
+if you feel you were misinterpreted or unfairly accused, chances are good there
+was something you could've communicated better — remember that it's your
+responsibility to make your fellow Rustaceans comfortable. Everyone wants to get
+along and we are all here first and foremost because we want to talk about cool
+technology. You will find that people will be eager to assume good intent and
+forgive as long as you earn their trust.
-The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
+The enforcement policies listed above apply to all official Rust venues;
+including official IRC channels (#rust, #rust-internals, #rust-tools,
+#rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang,
+and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and
+rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org,
+internals.rust-lang.org). For other projects adopting the Rust Code of Conduct,
+please contact the maintainers of those projects for enforcement. If you wish to
+use this code of conduct for your own project, consider explicitly mentioning
+your moderation policy or making a copy with your own moderation policy so as to
+avoid confusion.
-*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*
+*Adapted from the
+[Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling)
+as well as the
+[Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*
[mod_team]: https://www.rust-lang.org/team.html#Moderation-team
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 660653908b..7da53d4e37 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,8 +1,8 @@
# Rust by Example contribution guidelines
Thank you for your interest in making Rust by Example (also known as RBE)
-better! We'd love to have your contribution. We expect all contributors to
-abide by the [Rust code of conduct], which you can find at that link or in the
+better! We'd love to have your contribution. We expect all contributors to abide
+by the [Rust code of conduct], which you can find at that link or in the
[`CODE_OF_CONDUCT.md`] file in this repository.
[Rust code of conduct]: https://www.rust-lang.org/policies/code-of-conduct
@@ -23,24 +23,24 @@ To make changes to RBE, please send in pull requests on GitHub to the `master`
branch. We'll review them and either merge or request changes. Travis CI tests
everything as well, so you may get feedback from it too.
-If you make additions or other changes to a pull request, feel free to either amend
-previous commits or only add new ones, however you prefer. We may ask you to squash
-your commits before merging, depending.
+If you make additions or other changes to a pull request, feel free to either
+amend previous commits or only add new ones, however you prefer. We may ask you
+to squash your commits before merging, depending.
## Issue Tracker
-You can find the issue tracker [on
-GitHub](https://github.com/rust-lang/rust-by-example/issues). If you've found a
-problem with RBE, please open an issue there.
+You can find the issue tracker
+[on GitHub](https://github.com/rust-lang/rust-by-example/issues). If you've
+found a problem with RBE, please open an issue there.
We use the following labels:
-* `enhancement`: This is for any request for new sections or functionality.
-* `bug`: This is for anything that's in RBE, but incorrect or not working.
-* `discussion`: A discussion about improving something in RBE; this may lead to new
- enhancement or bug issues.
-* `E-mentor`: This issue has someone dedicated to helping a new contributor fix it!
- Can apply to both enhancement or bug issues.
+- `enhancement`: This is for any request for new sections or functionality.
+- `bug`: This is for anything that's in RBE, but incorrect or not working.
+- `discussion`: A discussion about improving something in RBE; this may lead to
+ new enhancement or bug issues.
+- `E-mentor`: This issue has someone dedicated to helping a new contributor fix
+ it! Can apply to both enhancement or bug issues.
## Development workflow
@@ -63,7 +63,8 @@ $ mdbook build
[install Rust]: http://rust-lang.org/install.html
The files will be in the `book` directory at the top-level; `mdbook serve` will
-open the contents in your web browser ([localhost:3000](http://localhost:3000) by default).
+open the contents in your web browser ([localhost:3000](http://localhost:3000)
+by default).
To run the tests:
@@ -71,6 +72,6 @@ To run the tests:
$ mdbook test
```
-If you're adding a new chapter, you'll need to edit `src\SUMMARY.md` to add it. If
-you're tweaking an existing example, you'll need to edit the corresponding file; check
-`src\SUMMARY.md` to see a mapping of where chapters go to files.
+If you're adding a new chapter, you'll need to edit `src\SUMMARY.md` to add it.
+If you're tweaking an existing example, you'll need to edit the corresponding
+file; check `src\SUMMARY.md` to see a mapping of where chapters go to files.
diff --git a/README.md b/README.md
index 3d979c4fc7..dc39baae7f 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,8 @@ Learn Rust with examples (Live code editor included)
## Using
-If you'd like to read Rust by Example, you can visit
-to read it online.
+If you'd like to read Rust by Example, you can visit
+ to read it online.
If you'd like to read it locally, [install Rust], and then:
@@ -36,7 +36,8 @@ read all content offline, however!
### Using translated version
-If there is a translated resource in `po/` directory, it can be specified through `MDBOOK_BOOK__LANGUAGE` like below:
+If there is a translated resource in `po/` directory, it can be specified
+through `MDBOOK_BOOK__LANGUAGE` like below:
```bash
git clone https://github.com/rust-lang/rust-by-example
@@ -60,31 +61,31 @@ Please see the [TRANSLATING.md] file for more details.
### Translating guide for each languages
-* Japanese/日本語: [TRANSLATING_JA.md]
+- Japanese/日本語: [TRANSLATING_JA.md]
[TRANSLATING_JA.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING_JA.md
## Translations to other languages
-* [Bulgarian](https://github.com/kberov/rust-by-example-bg)
-* [Chinese](https://github.com/rust-lang-cn/rust-by-example-cn)
-* [Japanese](https://github.com/rust-lang-ja/rust-by-example-ja)
-* [French](https://github.com/Songbird0/FR_RBE)
-* [Russian](https://github.com/ruRust/rust-by-example)
-* [Vietnamese](https://github.com/EyesCrypto-Insights/rust-by-example-vn)
-* [Portuguese](https://github.com/nazarepiedady/rust-com-exemplos)
+- [Bulgarian](https://github.com/kberov/rust-by-example-bg)
+- [Chinese](https://github.com/rust-lang-cn/rust-by-example-cn)
+- [Japanese](https://github.com/rust-lang-ja/rust-by-example-ja)
+- [French](https://github.com/Songbird0/FR_RBE)
+- [Russian](https://github.com/ruRust/rust-by-example)
+- [Vietnamese](https://github.com/EyesCrypto-Insights/rust-by-example-vn)
+- [Portuguese](https://github.com/nazarepiedady/rust-com-exemplos)
## License
Rust by Example is licensed under either of
-* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
+- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
)
-* MIT license ([LICENSE-MIT](LICENSE-MIT) or
+- MIT license ([LICENSE-MIT](LICENSE-MIT) or
)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
-for inclusion in Rust by Example by you, as defined in the Apache-2.0 license, shall be
-dually licensed as above, without any additional terms or conditions.
+for inclusion in Rust by Example by you, as defined in the Apache-2.0 license,
+shall be dually licensed as above, without any additional terms or conditions.
diff --git a/TRANSLATING.md b/TRANSLATING.md
index c2a39f51bb..894d502db8 100644
--- a/TRANSLATING.md
+++ b/TRANSLATING.md
@@ -1,7 +1,7 @@
# Rust by Example translation guidelines
-Please see the [CONTRIBUTING.md] file for general contribution guidelines.
-This file describes about the translation workflow.
+Please see the [CONTRIBUTING.md] file for general contribution guidelines. This
+file describes about the translation workflow.
[CONTRIBUTING.md]: https://github.com/rust-lang/rust-by-example/blob/master/CONTRIBUTING.md
@@ -9,20 +9,23 @@ This file describes about the translation workflow.
### Preparation
-RBE uses [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) as a translation framework.
-The following tools are required.
+RBE uses [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) as
+a translation framework. The following tools are required.
-* GNU gettext utilities ( `msgmerge` and `msgcat` )
-* mdbook-i18n-helpers ( `cargo install mdbook-i18n-helpers` )
+- GNU gettext utilities ( `msgmerge` and `msgcat` )
+- mdbook-i18n-helpers ( `cargo install mdbook-i18n-helpers` )
### Creating and Updating Translations
-Please see the [mdbook-i18n-helpers USAGE](https://github.com/google/mdbook-i18n-helpers/blob/main/i18n-helpers/USAGE.md) file for the detailed usage of mdbook-i18n-helpers.
-The summarized command list is below:
+Please see the
+[mdbook-i18n-helpers USAGE](https://github.com/google/mdbook-i18n-helpers/blob/main/i18n-helpers/USAGE.md)
+file for the detailed usage of mdbook-i18n-helpers. The summarized command list
+is below:
#### Generating a message template
-The generated message templete `po/messages.pot` is required to create or update translations.
+The generated message templete `po/messages.pot` is required to create or update
+translations.
```bash
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' \
@@ -31,7 +34,8 @@ MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' \
#### Creating a new translation resource
-`xx` is [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code.
+`xx` is [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
+language code.
```bash
msginit -i po/messages.pot -l xx -o po/xx.po
@@ -45,8 +49,9 @@ msgmerge --update po/xx.po po/messages.pot
### Editing translation resources
-After generating a translation resource `po/xx.po`, you can write translation messages in `msgstr` entry of `po/xx.po`.
-To build a translated book, the following command can be used.
+After generating a translation resource `po/xx.po`, you can write translation
+messages in `msgstr` entry of `po/xx.po`. To build a translated book, the
+following command can be used.
```bash
MDBOOK_BOOK__LANGUAGE=xx mdbook build
@@ -55,9 +60,10 @@ MDBOOK_BOOK__LANGUAGE=xx mdbook serve
### Add a language entry
-Please add a language entry in `.github/workflows/rbe.yml` and `theme/index.hbs` like below:
+Please add a language entry in `.github/workflows/rbe.yml` and `theme/index.hbs`
+like below:
-* `rbe.yml`
+- `rbe.yml`
```yml
env:
@@ -65,7 +71,7 @@ env:
LANGUAGES: xx yy zz
```
-* `index.hbs`
+- `index.hbs`
```html