Skip to content

Commit

Permalink
Merge pull request #109 from ferrous-systems/typos
Browse files Browse the repository at this point in the history
Typos
  • Loading branch information
jonathanpallant authored Oct 19, 2023
2 parents f0b120e + ac4a084 commit a2e7d32
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion training-slides/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Topics about using Rust on ARM Cortex-M Microcontrollers (and similar). Requires

* [Overview of Bare-Metal Rust](./rust-bare-metal.md)
* [Booting a Cortex-M Microcontroller (TBC)](./cortex-m-booting.md)
* [Execptions and Interrupts on a Cortex-M Microcontroller (TBC)](./cortex-m-exceptions-interrupts.md)
* [Exceptions and Interrupts on a Cortex-M Microcontroller (TBC)](./cortex-m-exceptions-interrupts.md)
* [PACs and svd2rust](./pac-svd2rust.md)
* [Writing Drivers](./writing-drivers.md)
* [The Embedded HAL and its implementations](./embedded-hals.md)
Expand Down
6 changes: 3 additions & 3 deletions training-slides/src/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ The second green object is the literal we gave to println - `s = `

* A growable collection of `char`
* Actually stored as a `Vec<u8>`, with UTF-8 encoding
* You cannot acccess characters by index (only bytes)
* You cannot access characters by index (only bytes)
* But you never really want to anyway

```mermaid
Expand Down Expand Up @@ -267,7 +267,7 @@ fn main() {
* Cannot borrow it as a single `&[T]` slice without moving items around
* Not great for insertion in the middle
* Everything must be of the same type
* Indicies are always `usize`
* Indices are always `usize`

## HashMap ([docs](https://doc.rust-lang.org/std/collections/struct.HashMap.html))

Expand Down Expand Up @@ -400,6 +400,6 @@ in half.
The 🤔 for indexing VecDeque is because you might have to get the contents in
two pieces (i.e. as two disjoint slices) due to wrap-around.

Tecnically you *can* insert into the middle of a Vec or a String, but we're
Technically you *can* insert into the middle of a Vec or a String, but we're
talking about 'cheap' insertions that don't involve moving too much stuff
around.
2 changes: 1 addition & 1 deletion training-slides/src/dynamic-dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Operation {

## Recommendation

Try to minimise repeated matches on the Enum, if not strictly necessary.
Try to minimize repeated matches on the Enum, if not strictly necessary.

## Trait Objects

Expand Down
4 changes: 2 additions & 2 deletions training-slides/src/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Note:

This was added in Rust 1.39.

The ? operator will evalulate to the `Ok` value if the `Result` is `Ok`, and it will cause an early return with the error value if it is `Err`. It will also call `.into()` to perform a type conversion if necessary (and if possible).
The ? operator will evaluate to the `Ok` value if the `Result` is `Ok`, and it will cause an early return with the error value if it is `Err`. It will also call `.into()` to perform a type conversion if necessary (and if possible).

## What kind of Error?

Expand Down Expand Up @@ -159,7 +159,7 @@ Setting `E` to be `String` lets you make up text at run-time:

## Using enums as the Err Type

An `enum` is ideal to express *one* of a number of differerent *kinds* of thing:
An `enum` is ideal to express *one* of a number of different *kinds* of thing:

```rust
/// Represents the ways this module can fail
Expand Down
6 changes: 3 additions & 3 deletions training-slides/src/ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Clearly these two compilers must agree, otherwise the callee will not receive th

x86 is ~40 years old and many standards exist on how to do this. See https://en.wikipedia.org/wiki/X86_calling_conventions#Historical_background.

AMD64 is only ~15 years old, and there are two standards - the Microsoft one for Windows, and the Linux one (which is based on System V UNIX).
AMD64 is only ~15 years old, and there are two standards - the Microsoft one for Windows, and the Linux one (which is based on System V UNIX).

---

Expand Down Expand Up @@ -113,7 +113,7 @@ extern "C" fn magicadder_process_value(adder: *const MagicAdder, value: u32) ->

Note:

The `.as_ref()` method on pointers *requires* that the pointer either be null, or that it point at a valid, aligned, fully initialised object. If they just feed you a random integer, bad things will happen, and we can't tell if they've done that!
The `.as_ref()` method on pointers *requires* that the pointer either be null, or that it point at a valid, aligned, fully initialized object. If they just feed you a random integer, bad things will happen, and we can't tell if they've done that!

## Matching C header

Expand Down Expand Up @@ -233,7 +233,7 @@ You cannot do `extern "C" fn some_function();` with no function body - you must

## Primitive types

Some type conversions can be infered by the compiler.
Some type conversions can be inferred by the compiler.

* `c_uint``u32`
* `c_int``i32`
Expand Down
4 changes: 2 additions & 2 deletions training-slides/src/heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ z @ 0x555829f269d0

The first `z @` line is the `struct String { ... }` itself. The second `z @` line are the bytes the `String` contains. They have a different addresses because they are in the heap and not on the stack.

If you run it multiple times, you will get different results. This is due to the Operating System randomising the virtual addresses used for the stack and the heap, to make security vulnerabilities harder to exploit.
If you run it multiple times, you will get different results. This is due to the Operating System randomizing the virtual addresses used for the stack and the heap, to make security vulnerabilities harder to exploit.

On macOS, you can run `vmmap <pid>` to print the addresses for each region. On Linux you can use `pmap <pid>`, or you could add something like:

Expand Down Expand Up @@ -266,4 +266,4 @@ Note:

`Cow` works on any `T` where there is both a *Borrowed* version and an *Owned* version.

For example, `&[u8]` and `Vec<u8>`.
For example, `&[u8]` and `Vec<u8>`.
6 changes: 3 additions & 3 deletions training-slides/src/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Rust is an empathic systems programming language that is determined to not let y
## Release Method

- Nightly releases
- experimental features are only present on nighly releases
- experimental features are only present on nightly releases
- Every 6 weeks, the current nightly is promoted to beta
- After 6 weeks of testing, beta becomes stable
- Guaranteed backwards-compatibility
Expand Down Expand Up @@ -90,8 +90,8 @@ Note:

- "Concurrency without fear"
- The type system detects concurrent access to data and requires
synchronisation
- Also: Rust detects when unsynchronised access is safely possible
synchronization
- Also: Rust detects when unsynchronized access is safely possible
- Protection from data races

## Fast
Expand Down
2 changes: 1 addition & 1 deletion training-slides/src/ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Ownership is the basis for the memory management of Rust.

- fundamental to Rust’s type system
- enforced at compile time
- important for optimisations
- important for optimizations

## Example

Expand Down
4 changes: 2 additions & 2 deletions training-slides/src/shared-mutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ These rules can be ... *bent*

## Why the rules exist...

* Optimisations!
* Optimizations!
* It is *undefined behaviour* (UB) to have multiple `&mut` references to the *same* object at the *same* time
* You *must* avoid UB

Expand Down Expand Up @@ -52,7 +52,7 @@ fn main() {

Note:

The `UnsafeCell::get(&self) -> *mut T` method is safe, but deferencing the pointer (or converting it to a `&mut` reference) is unsafe because a human must verify there is no aliasing.
The `UnsafeCell::get(&self) -> *mut T` method is safe, but dereferencing the pointer (or converting it to a `&mut` reference) is unsafe because a human must verify there is no aliasing.

## Can we be safer?

Expand Down
2 changes: 1 addition & 1 deletion training-slides/src/start_here.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ graph TD;
* **Applied Rust**: Using Rust with Windows, macOS or Linux.
* **Advanced Rust**: Deep-dives into specific topics.
* **Async Rust**: Futures, Polling, Tokio, and all that jazz.
* **Ferrocene**: Working with our qualfied toolchain
* **Ferrocene**: Working with our qualified toolchain
* **No-Std Rust**: Rust without the Standard Library.
* **Bare-Metal Rust**: Rust on a micro-controller.
* **Using Embassy**: Async-Rust on a micro-controller.
Expand Down
6 changes: 3 additions & 3 deletions training-slides/src/working-with-nighly.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Features are gated behind "Feature Flags" which are enabled project wide.
Some examples:

- `asm` which provides inline assembly support
- `no_std` which disables implict `extern crate std`
- `no_std` which disables implicit `extern crate std`
- `inclusive_range`, similar to the stable `exclusive_range`

## Enabling Features
Expand Down Expand Up @@ -52,8 +52,8 @@ To enable a compiler plugin add the following line into `src/main.rs` (for execu

## Warning

It is unknown, when and if ever compiler-plugins will be stabilised.
It is unknown, when and if ever compiler-plugins will be stabilized.

## Stable development on nightly

It is recommendable to use a nighly compiler close to the release version used.
It is recommendable to use a nightly compiler close to the release version used.

0 comments on commit a2e7d32

Please sign in to comment.