Render the book in PDF using pandoc and LaTeX. (#126)

* Render the book in PDF using `pandoc` and LaTeX.

* Fix installs.

* Go the apt-get route

* Another attempt

* Avoid installing twice.

* Re-order.

* Add more packages.

* Minimise deps. Fix link checker.

* Missing package.

* Missing package.

* Missing package.

* More packages.

* Missing package.

* Missing package.

* More packages...

* Remove.

* Fix link checker.

* Fix link checker.

* Fix path.

* Add subtitle.

* Avoid running over the right margin.

* Avoid running over the right margin.

* Formatting
This commit is contained in:
Luca Palmieri
2024-08-05 17:52:15 +02:00
committed by GitHub
parent e732ea82e4
commit 96f06708b0
25 changed files with 401 additions and 213 deletions

View File

@@ -94,7 +94,8 @@ fn print_if_even<T>(n: T) {
This code won't compile:
```text
error[E0599]: no method named `is_even` found for type parameter `T` in the current scope
error[E0599]: no method named `is_even` found for type parameter `T`
in the current scope
--> src/lib.rs:2:10
|
1 | fn print_if_even<T>(n: T) {
@@ -106,7 +107,9 @@ error[E0277]: `T` doesn't implement `Debug`
--> src/lib.rs:3:19
|
3 | println!("{n:?} is even");
| ^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
| ^^^^^
| `T` cannot be formatted using `{:?}` because
| it doesn't implement `Debug`
|
help: consider restricting type parameter `T`
|

View File

@@ -72,7 +72,8 @@ You can, for example, create a `&str` from a `String` like this:
```rust
let mut s = String::with_capacity(5);
s.push_str("Hello");
// Create a string slice reference from the `String`, skipping the first byte.
// Create a string slice reference from the `String`,
// skipping the first byte.
let slice: &str = &s[1..];
```

View File

@@ -11,7 +11,8 @@ to the pointer: the length of the slice it points to. Going back to the example
```rust
let mut s = String::with_capacity(5);
s.push_str("Hello");
// Create a string slice reference from the `String`, skipping the first byte.
// Create a string slice reference from the `String`,
// skipping the first byte.
let slice: &str = &s[1..];
```

View File

@@ -3,7 +3,11 @@
Let's go back to where our string journey started:
```rust
let ticket = Ticket::new("A title".into(), "A description".into(), "To-Do".into());
let ticket = Ticket::new(
"A title".into(),
"A description".into(),
"To-Do".into()
);
```
We now know enough to start unpacking what `.into()` is doing here.
@@ -14,7 +18,11 @@ This is the signature of the `new` method:
```rust
impl Ticket {
pub fn new(title: String, description: String, status: String) -> Self {
pub fn new(
title: String,
description: String,
status: String
) -> Self {
// [...]
}
}

View File

@@ -44,7 +44,8 @@ impl Drop for MyType {
The compiler will complain with this error message:
```text
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
error[E0184]: the trait `Copy` cannot be implemented for this type;
the type has a destructor
--> src/lib.rs:2:17
|
2 | #[derive(Clone, Copy)]