From 7a4fa2d1f406420b75d3787aa8935fbff3f390da Mon Sep 17 00:00:00 2001 From: Sympatron GmbH <35803463+Sympatron@users.noreply.github.com> Date: Fri, 24 May 2024 12:57:57 +0200 Subject: [PATCH] Fix broken links (#47) --- book/src/02_basic_calculator/01_integers.md | 4 ++-- book/src/02_basic_calculator/04_panics.md | 2 +- book/src/02_basic_calculator/10_as_casting.md | 2 +- book/src/03_ticket_v1/05_encapsulation.md | 2 +- book/src/03_ticket_v1/10_references_in_memory.md | 2 +- book/src/04_traits/08_sized.md | 2 +- book/src/05_ticket_v2/09_error_trait.md | 2 +- book/src/05_ticket_v2/13_try_from.md | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/book/src/02_basic_calculator/01_integers.md b/book/src/02_basic_calculator/01_integers.md index 48f5d1f..7fb37b1 100644 --- a/book/src/02_basic_calculator/01_integers.md +++ b/book/src/02_basic_calculator/01_integers.md @@ -117,7 +117,7 @@ error[E0308]: mismatched types | ``` -We'll see how to convert between types [later in this course](../04_traits/08_from). +We'll see how to convert between types [later in this course](../04_traits/09_from). ## References @@ -134,5 +134,5 @@ behave. We'll talk about operator overloading [later in the course](../04_traits/03_operator_overloading), after we've covered traits. [^coercion]: There are some exceptions to this rule, mostly related to references, smart pointers and ergonomics. We'll -cover those [later on](../04_traits/06_deref). +cover those [later on](../04_traits/07_deref). A mental model of "all conversions are explicit" will serve you well in the meantime. diff --git a/book/src/02_basic_calculator/04_panics.md b/book/src/02_basic_calculator/04_panics.md index bbfcdf0..fa658fa 100644 --- a/book/src/02_basic_calculator/04_panics.md +++ b/book/src/02_basic_calculator/04_panics.md @@ -1,6 +1,6 @@ # Panics -Let's go back to the `speed` function you wrote for the ["Variables" section](../02_variables/README.md). +Let's go back to the `speed` function you wrote for the ["Variables" section](02_variables). It probably looked something like this: ```rust diff --git a/book/src/02_basic_calculator/10_as_casting.md b/book/src/02_basic_calculator/10_as_casting.md index e878f63..92ffc86 100644 --- a/book/src/02_basic_calculator/10_as_casting.md +++ b/book/src/02_basic_calculator/10_as_casting.md @@ -92,7 +92,7 @@ It is also fairly limited: you can only rely on `as` casting for primitive types and a few other special cases. When working with composite types, you'll have to rely on different conversion mechanisms ([fallible](../05_ticket_v2/13_try_from) -and [infallible](../04_traits/08_from)), which we'll explore later on. +and [infallible](../04_traits/09_from)), which we'll explore later on. ## References diff --git a/book/src/03_ticket_v1/05_encapsulation.md b/book/src/03_ticket_v1/05_encapsulation.md index ae79d88..f01b1b8 100644 --- a/book/src/03_ticket_v1/05_encapsulation.md +++ b/book/src/03_ticket_v1/05_encapsulation.md @@ -38,7 +38,7 @@ let ticket = Ticket { You've seen this in action in the previous exercise on visibility. We now need to provide one or more public **constructors**—i.e. static methods or functions that can be used from outside the module to create a new instance of the struct. -Luckily enough we already have one: `Ticket::new`, as implemented in [a previous exercise](../02_validation/README.md). +Luckily enough we already have one: `Ticket::new`, as implemented in [a previous exercise](02_validation). ## Accessor methods diff --git a/book/src/03_ticket_v1/10_references_in_memory.md b/book/src/03_ticket_v1/10_references_in_memory.md index e9b6f39..e7c208f 100644 --- a/book/src/03_ticket_v1/10_references_in_memory.md +++ b/book/src/03_ticket_v1/10_references_in_memory.md @@ -49,6 +49,6 @@ They just point to a memory location, which _may_ be on the heap, but doesn't ha - The exercise for this section is located in `exercises/03_ticket_v1/10_references_in_memory` -[^fat]: [Later in the course](../04_traits/05_str_slice) we'll talk about **fat pointers**, +[^fat]: [Later in the course](../04_traits/06_str_slice) we'll talk about **fat pointers**, i.e. pointers with additional metadata. As the name implies, they are larger than the pointers we discussed in this chapter, also known as **thin pointers**. diff --git a/book/src/04_traits/08_sized.md b/book/src/04_traits/08_sized.md index b26996e..57d0d38 100644 --- a/book/src/04_traits/08_sized.md +++ b/book/src/04_traits/08_sized.md @@ -6,7 +6,7 @@ From our previous [discussion on memory layouts](../03_ticket_v1/10_references_i it would have been reasonable to expect `&str` to be represented as a single `usize` on the stack, a pointer. That's not the case though. `&str` stores some **metadata** next to the pointer: the length of the slice it points to. Going back to the example from -[a previous section](05_str_slice.md): +[a previous section](06_str_slice): ```rust let mut s = String::with_capacity(5); diff --git a/book/src/05_ticket_v2/09_error_trait.md b/book/src/05_ticket_v2/09_error_trait.md index ae22722..ccace7b 100644 --- a/book/src/05_ticket_v2/09_error_trait.md +++ b/book/src/05_ticket_v2/09_error_trait.md @@ -22,7 +22,7 @@ that implements the `Error` trait. pub trait Error: Debug + Display {} ``` -You might recall the `:` syntax from [the `Sized` trait](../04_traits/07_sized.md)—it's used to specify **supertraits**. +You might recall the `:` syntax from [the `Sized` trait](../04_traits/08_sized.md)—it's used to specify **supertraits**. For `Error`, there are two supertraits: `Debug` and `Display`. If a type wants to implement `Error`, it must also implement `Debug` and `Display`. diff --git a/book/src/05_ticket_v2/13_try_from.md b/book/src/05_ticket_v2/13_try_from.md index ab65d4d..c5ecf5d 100644 --- a/book/src/05_ticket_v2/13_try_from.md +++ b/book/src/05_ticket_v2/13_try_from.md @@ -1,6 +1,6 @@ # `TryFrom` and `TryInto` -In the previous chapter we looked at the [`From` and `Into` traits](../04_traits/08_from.md), +In the previous chapter we looked at the [`From` and `Into` traits](../04_traits/09_from.md), Rust's idiomatic interfaces for **infallible** type conversions. But what if the conversion is not guaranteed to succeed?