diff --git a/src/bare-metal/aps/mmio.md b/src/bare-metal/aps/mmio.md index 47b81df4..3e18b500 100644 --- a/src/bare-metal/aps/mmio.md +++ b/src/bare-metal/aps/mmio.md @@ -1,10 +1,14 @@ # Volatile memory access for MMIO -- Use `pointer::read_volatile` and `pointer::write_volatile`. +- Use [`pointer::read_volatile`] and [`pointer::write_volatile`]. - Never hold a reference. -- `addr_of!` lets you get fields of structs without creating an intermediate +- Use [`addr_of!`] to get fields of structs without creating an intermediate reference. +[`pointer::read_volatile`]: https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.read_volatile +[`pointer::write_volatile`]: https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.write_volatile +[`addr_of!`]: https://doc.rust-lang.org/stable/core/ptr/macro.addr_of.html +
- Volatile access: read or write operations may have side-effects, so prevent diff --git a/src/error-handling/anyhow.md b/src/error-handling/anyhow.md index 10992257..fe1bcf2a 100644 --- a/src/error-handling/anyhow.md +++ b/src/error-handling/anyhow.md @@ -4,13 +4,16 @@ minutes: 5 # `anyhow` -The [`anyhow`](https://docs.rs/anyhow/) crate provides a rich error type with -support for carrying additional contextual information, which can be used to -provide a semantic trace of what the program was doing leading up to the error. +The [`anyhow`] crate provides a rich error type with support for carrying +additional contextual information, which can be used to provide a semantic trace +of what the program was doing leading up to the error. -This can be combined with the convenience macros from `thiserror` to avoid +This can be combined with the convenience macros from [`thiserror`] to avoid writing out trait impls explicitly for custom error types. +[`anyhow`]: https://docs.rs/anyhow/ +[`thiserror`]: https://docs.rs/thiserror/ + ```rust,editable,compile_fail use anyhow::{bail, Context, Result}; use std::fs; diff --git a/src/error-handling/exercise.md b/src/error-handling/exercise.md index 0da38106..16309dc6 100644 --- a/src/error-handling/exercise.md +++ b/src/error-handling/exercise.md @@ -7,7 +7,10 @@ minutes: 30 The following implements a very simple parser for an expression language. However, it handles errors by panicking. Rewrite it to instead use idiomatic error handling and propagate errors to a return from `main`. Feel free to use -`thiserror` and `anyhow`. +[`thiserror`] and [`anyhow`]. + +[`thiserror`]: https://docs.rs/thiserror +[`anyhow`]: https://docs.rs/anyhow HINT: start by fixing error handling in the `parse` function. Once that is working correctly, update `Tokenizer` to implement