Skip to content

Commit f9a1d42

Browse files
Adjust margins for paperback version. Ensure nothing breaches the right margin.
1 parent 05e3efd commit f9a1d42

File tree

8 files changed

+19
-15
lines changed

8 files changed

+19
-15
lines changed

book/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ monofontfallback = [
6161
urlstyle = "rm"
6262
documentclass = "book"
6363
fontsize = "11pt"
64-
geometry = "papersize={8in,10in},top=2cm,bottom=2cm,left=2.4cm,right=2.4cm"
64+
geometry = "papersize={8in,10in},top=2cm,bottom=2cm,left=2.8cm,right=2.5cm"
6565
header-includes = [
6666
# Reduce font size of code blocks
6767
"\\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\\\\{\\},fontsize=\\small}",

book/src/01_intro/00_welcome.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ also find solutions to all exercises in the
3434

3535
## Formats
3636

37-
You can browse the course material in the browser, at [rust-exercises.com/100-exercises/](https://rust-exercises.com/100-exercises/).\
38-
You can also [download the course material as a PDF file](https://rust-exercises.com/100-exercises-to-learn-rust.pdf), for offline reading.
37+
You can go through the course material [in the browser](https://rust-exercises.com/100-exercises/).\
38+
You can also [download it as a PDF file](https://rust-exercises.com/100-exercises-to-learn-rust.pdf), for offline reading.
3939

4040
## Structure
4141

@@ -51,8 +51,7 @@ Before starting the course, make sure to clone the repository to your local mach
5151
# If you have an SSH key set up with GitHub
5252
git clone [email protected]:mainmatter/100-exercises-to-learn-rust.git
5353
# Otherwise, use the HTTPS URL:
54-
#
55-
# git clone https://github.com/mainmatter/100-exercises-to-learn-rust.git
54+
# https://github.com/mainmatter/100-exercises-to-learn-rust.git
5655
```
5756

5857
We also recommend you work on a branch, so you can easily track your progress and pull

book/src/01_intro/01_syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The function's body is enclosed in curly braces `{}`.
3232
In previous exercise, you saw the `greeting` function:
3333

3434
```rust
35-
// `fn` <function_name> ( <input parameters> ) -> <return_type> { <body> }
35+
// `fn` <function_name> ( <input params> ) -> <return_type> { <body> }
3636
fn greeting() -> &'static str {
3737
// TODO: fix me 👇
3838
"I'm ready to __!"

book/src/03_ticket_v1/06_ownership.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ Ownership can be transferred.
9797
If you own a value, for example, you can transfer ownership to another variable:
9898

9999
```rust
100-
let a = "hello, world".to_string(); // <--- `a` is the owner of the String
101-
let b = a; // <--- `b` is now the owner of the String
100+
let a = "hello, world".to_string(); // <- `a` is the owner of the String
101+
let b = a; // <- `b` is now the owner of the String
102102
```
103103

104104
Rust's ownership system is baked into the type system: each function has to declare in its signature

book/src/04_traits/04_derive.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ although a bit more cumbersome to read:
8989
impl ::core::cmp::PartialEq for Ticket {
9090
#[inline]
9191
fn eq(&self, other: &Ticket) -> bool {
92-
self.title == other.title && self.description == other.description
92+
self.title == other.title
93+
&& self.description == other.description
9394
&& self.status == other.status
9495
}
9596
}

book/src/04_traits/05_trait_bounds.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ error[E0599]: no method named `is_even` found for type parameter `T`
9999
--> src/lib.rs:2:10
100100
|
101101
1 | fn print_if_even<T>(n: T) {
102-
| - method `is_even` not found for this type parameter
102+
| - method `is_even` not found
103+
| for this type parameter
103104
2 | if n.is_even() {
104105
| ^^^^^^^ method not found in `T`
105106

book/src/07_threads/11_locks.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ fn main() {
111111
The compiler is not happy with this code:
112112

113113
```text
114-
error[E0277]: `MutexGuard<'_, i32>` cannot be sent between threads safely
114+
error[E0277]: `MutexGuard<'_, i32>` cannot be sent between
115+
threads safely
115116
--> src/main.rs:10:7
116117
|
117118
10 | spawn(move || {
@@ -122,9 +123,10 @@ error[E0277]: `MutexGuard<'_, i32>` cannot be sent between threads safely
122123
12 | | });
123124
| |_^ `MutexGuard<'_, i32>` cannot be sent between threads safely
124125
|
125-
= help: the trait `Send` is not implemented for `MutexGuard<'_, i32>`,
126-
which is required by `{closure@src/main.rs:10:7: 10:14}: Send`
127-
= note: required for `std::sync::mpsc::Receiver<MutexGuard<'_, i32>>`
126+
= help: the trait `Send` is not implemented for
127+
`MutexGuard<'_, i32>`, which is required by
128+
`{closure@src/main.rs:10:7: 10:14}: Send`
129+
= note: required for `Receiver<MutexGuard<'_, i32>>`
128130
to implement `Send`
129131
note: required because it's used within this closure
130132
```

book/src/08_futures/04_future.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ The compiler will reject this code:
4747
error: future cannot be sent between threads safely
4848
|
4949
5 | tokio::spawn(example());
50-
| ^^^^^^^^^ future returned by `example` is not `Send`
50+
| ^^^^^^^^^
51+
| future returned by `example` is not `Send`
5152
|
5253
note: future is not `Send` as this value is used across an await
5354
|

0 commit comments

Comments
 (0)