From a21a6b8585bb90d59e60e3426c2d7a15ec9e5e8d Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Wed, 25 Oct 2023 21:02:26 +0200 Subject: [PATCH] Re-apply formatting to SUMMARY.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the latest version of mdbook-i18n-helpers, we now have support for formatting in the `SUMMARY.md` file. This allows us to revert the changes made in #130 when we first introduced the translation support. This also aligns a few headings to match the heading in the outline. While this isn’t strictly necessary, it removes a bit of work for the translators. --- src/SUMMARY.md | 82 +++++++++++++++--------------- src/async/pitfalls/pin.md | 4 +- src/control-flow/break-continue.md | 2 +- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 522f3e8c8560..875c2207fde0 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -31,37 +31,37 @@ - [References](basic-syntax/references.md) - [Dangling References](basic-syntax/references-dangling.md) - [Slices](basic-syntax/slices.md) - - [String vs str](basic-syntax/string-slices.md) + - [`String` vs `str`](basic-syntax/string-slices.md) - [Functions](basic-syntax/functions.md) - [Rustdoc](basic-syntax/rustdoc.md) - [Methods](basic-syntax/methods.md) - [Overloading](basic-syntax/functions-interlude.md) - [Exercises](exercises/day-1/morning.md) - [Implicit Conversions](exercises/day-1/implicit-conversions.md) - - [Arrays and for Loops](exercises/day-1/for-loops.md) + - [Arrays and `for` Loops](exercises/day-1/for-loops.md) # Day 1: Afternoon - [Control Flow](control-flow.md) - [Blocks](control-flow/blocks.md) - - [if expressions](control-flow/if-expressions.md) - - [for expressions](control-flow/for-expressions.md) - - [while expressions](control-flow/while-expressions.md) - - [break & continue](control-flow/break-continue.md) - - [loop expressions](control-flow/loop-expressions.md) + - [`if` expressions](control-flow/if-expressions.md) + - [`for` expressions](control-flow/for-expressions.md) + - [`while` expressions](control-flow/while-expressions.md) + - [`break` & `continue`](control-flow/break-continue.md) + - [`loop` expressions](control-flow/loop-expressions.md) - [Variables](basic-syntax/variables.md) - [Type Inference](basic-syntax/type-inference.md) - - [static & const](basic-syntax/static-and-const.md) + - [`static` & `const`](basic-syntax/static-and-const.md) - [Scopes and Shadowing](basic-syntax/scopes-shadowing.md) - [Enums](enums.md) - [Variant Payloads](enums/variant-payloads.md) - [Enum Sizes](enums/sizes.md) - [Novel Control Flow](control-flow/novel.md) - - [if let expressions](control-flow/if-let-expressions.md) - - [while let expressions](control-flow/while-let-expressions.md) - - [match expressions](control-flow/match-expressions.md) + - [`if let` expressions](control-flow/if-let-expressions.md) + - [`while let` expressions](control-flow/while-let-expressions.md) + - [`match` expressions](control-flow/match-expressions.md) - [Pattern Matching](pattern-matching.md) - [Destructuring Enums](pattern-matching/destructuring-enums.md) @@ -110,15 +110,15 @@ # Day 2: Afternoon - [Standard Library](std.md) - - [Option and Result](std/option-result.md) - - [String](std/string.md) - - [Vec](std/vec.md) - - [HashMap](std/hashmap.md) - - [Box](std/box.md) + - [`Option` and `Result`](std/option-result.md) + - [`String`](std/string.md) + - [`Vec`](std/vec.md) + - [`HashMap`](std/hashmap.md) + - [`Box`](std/box.md) - [Recursive Data Types](std/box-recursive.md) - [Niche Optimization](std/box-niche.md) - - [Rc](std/rc.md) - - [Cell/RefCell](std/cell.md) + - [`Rc`](std/rc.md) + - [`Cell` & `RefCell`](std/cell.md) - [Modules](modules.md) - [Visibility](modules/visibility.md) - [Paths](modules/paths.md) @@ -142,16 +142,16 @@ - [Deriving Traits](traits/deriving-traits.md) - [Default Methods](traits/default-methods.md) - [Trait Bounds](traits/trait-bounds.md) - - [impl Trait](traits/impl-trait.md) + - [`impl Trait`](traits/impl-trait.md) - [Important Traits](traits/important-traits.md) - - [Iterator](traits/iterator.md) - - [FromIterator](traits/from-iterator.md) - - [From and Into](traits/from-into.md) - - [Read and Write](traits/read-write.md) - - [Drop](traits/drop.md) - - [Default](traits/default.md) - - [Operators: Add, Mul, ...](traits/operators.md) - - [Closures: Fn, FnMut, FnOnce](traits/closures.md) + - [`Iterator`](traits/iterator.md) + - [`FromIterator`](traits/from-iterator.md) + - [`From` & `Into`](traits/from-into.md) + - [`Read` & `Write`](traits/read-write.md) + - [`Drop`](traits/drop.md) + - [`Default`](traits/default.md) + - [Operators: `Add`, `Mul`, ...](traits/operators.md) + - [Closures: `Fn`, `FnMut`, `FnOnce`](traits/closures.md) - [Exercises](exercises/day-3/morning.md) - [A Simple GUI Library](exercises/day-3/simple-gui.md) - [Points and Polygons](exercises/day-3/points-polygons.md) @@ -162,7 +162,7 @@ - [Panics](error-handling/panics.md) - [Catching Stack Unwinding](error-handling/panic-unwind.md) - [Structured Error Handling](error-handling/result.md) - - [Propagating Errors with ?](error-handling/try-operator.md) + - [Propagating Errors with `?`](error-handling/try-operator.md) - [Converting Error Types](error-handling/converting-error-types.md) - [Example](error-handling/converting-error-types-example.md) - [Deriving Error Enums](error-handling/deriving-error-enums.md) @@ -251,13 +251,13 @@ - [Exceptions](bare-metal/aps/exceptions.md) - [Other Projects](bare-metal/aps/other-projects.md) - [Useful Crates](bare-metal/useful-crates.md) - - [zerocopy](bare-metal/useful-crates/zerocopy.md) - - [aarch64-paging](bare-metal/useful-crates/aarch64-paging.md) - - [buddy_system_allocator](bare-metal/useful-crates/buddy_system_allocator.md) - - [tinyvec](bare-metal/useful-crates/tinyvec.md) - - [spin](bare-metal/useful-crates/spin.md) + - [`zerocopy`](bare-metal/useful-crates/zerocopy.md) + - [`aarch64-paging`](bare-metal/useful-crates/aarch64-paging.md) + - [`buddy_system_allocator`](bare-metal/useful-crates/buddy_system_allocator.md) + - [`tinyvec`](bare-metal/useful-crates/tinyvec.md) + - [`spin`](bare-metal/useful-crates/spin.md) - [Android](bare-metal/android.md) - - [vmbase](bare-metal/android/vmbase.md) + - [`vmbase`](bare-metal/android/vmbase.md) - [Exercises](exercises/bare-metal/afternoon.md) - [RTC Driver](exercises/bare-metal/rtc.md) @@ -272,13 +272,13 @@ - [Channels](concurrency/channels.md) - [Unbounded Channels](concurrency/channels/unbounded.md) - [Bounded Channels](concurrency/channels/bounded.md) -- [Send and Sync](concurrency/send-sync.md) - - [Send](concurrency/send-sync/send.md) - - [Sync](concurrency/send-sync/sync.md) +- [`Send` and `Sync`](concurrency/send-sync.md) + - [`Send`](concurrency/send-sync/send.md) + - [`Sync`](concurrency/send-sync/sync.md) - [Examples](concurrency/send-sync/examples.md) - [Shared State](concurrency/shared_state.md) - - [Arc](concurrency/shared_state/arc.md) - - [Mutex](concurrency/shared_state/mutex.md) + - [`Arc`](concurrency/shared_state/arc.md) + - [`Mutex`](concurrency/shared_state/mutex.md) - [Example](concurrency/shared_state/example.md) - [Exercises](exercises/concurrency/morning.md) - [Dining Philosophers](exercises/concurrency/dining-philosophers.md) @@ -287,7 +287,7 @@ # Concurrency: Afternoon - [Async Basics](async.md) - - [async/await](async/async-await.md) + - [`async`/`await`](async/async-await.md) - [Futures](async/futures.md) - [Runtimes](async/runtimes.md) - [Tokio](async/runtimes/tokio.md) @@ -298,7 +298,7 @@ - [Select](async/control-flow/select.md) - [Pitfalls](async/pitfalls.md) - [Blocking the Executor](async/pitfalls/blocking-executor.md) - - [Pin](async/pitfalls/pin.md) + - [`Pin`](async/pitfalls/pin.md) - [Async Traits](async/pitfalls/async-traits.md) - [Cancellation](async/pitfalls/cancellation.md) - [Exercises](exercises/concurrency/afternoon.md) diff --git a/src/async/pitfalls/pin.md b/src/async/pitfalls/pin.md index a6b92112d171..a6f85b73d4c3 100644 --- a/src/async/pitfalls/pin.md +++ b/src/async/pitfalls/pin.md @@ -1,4 +1,4 @@ -# Pin +# `Pin` When you await a future, all local variables (that would ordinarily be stored on a stack frame) are instead stored in the Future for the current async block. If your @@ -6,7 +6,7 @@ future has pointers to data on the stack, those pointers might get invalidated. This is unsafe. Therefore, you must guarantee that the addresses your future points to don't -change. That is why we need to `pin` futures. Using the same future repeatedly +change. That is why we need to "pin" futures. Using the same future repeatedly in a `select!` often leads to issues with pinned values. ```rust,editable,compile_fail diff --git a/src/control-flow/break-continue.md b/src/control-flow/break-continue.md index 1b562dc3f0ac..85b7921e63bc 100644 --- a/src/control-flow/break-continue.md +++ b/src/control-flow/break-continue.md @@ -1,4 +1,4 @@ -# `break` and `continue` +# `break` & `continue` - If you want to exit a loop early, use [`break`](https://doc.rust-lang.org/reference/expressions/loop-expr.html#break-expressions), - If you want to immediately start