Compare commits
9 Commits
12fb62d8be
...
9e63a5cdf6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e63a5cdf6 | ||
|
|
f4a7472f30 | ||
|
|
04b89ff26e | ||
|
|
26e78072cd | ||
|
|
c540242c15 | ||
|
|
f14a047e8b | ||
|
|
5e23bee61e | ||
|
|
8488317564 | ||
|
|
4ca49fa5fd |
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -19,17 +19,27 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get Core Sans
|
||||
uses: actions/checkout@v4
|
||||
if: "!github.event.pull_request.head.repo.fork"
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository: mainmatter/core-sans-a-fonts
|
||||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
path: core-sans-a-fonts
|
||||
- name: Install Fonts
|
||||
- name: Install Core Sans Font
|
||||
if: "!github.event.pull_request.head.repo.fork"
|
||||
run: |
|
||||
sudo cp -r core-sans-a-fonts/* /usr/local/share/fonts/
|
||||
sudo fc-cache -f -v
|
||||
fc-list | grep "Core Sans"
|
||||
- name: Use Fallback font for fork PRs
|
||||
if: "github.event.pull_request.head.repo.fork"
|
||||
run: |
|
||||
sed -i 's/"BoldFont=CoreSansA65.ttf",//g' book/book.toml
|
||||
sed -i 's/"ItalicFont=CoreSansA45It.ttf",//g' book/book.toml
|
||||
sed -i 's/"BoldItalicFont=CoreSansA65It.ttf",//g' book/book.toml
|
||||
sed -i 's/CoreSansA45.ttf/Open Sans:style=Regular/g' book/book.toml
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- name: Install exercise plugin
|
||||
run: cargo install --path helpers/mdbook-exercise-linker
|
||||
@@ -39,8 +49,8 @@ jobs:
|
||||
run: |
|
||||
cargo install mdbook-pandoc --locked --version 0.7.1
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fonts-noto calibre pdftk
|
||||
|
||||
sudo apt-get install -y fonts-noto fonts-open-sans calibre pdftk
|
||||
sudo fc-cache -f -v
|
||||
export PANDOC_VERSION=3.3
|
||||
curl -LsSf https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz | tar zxf -
|
||||
echo "$PWD/pandoc-${PANDOC_VERSION}/bin" >> $GITHUB_PATH
|
||||
|
||||
@@ -49,8 +49,8 @@ sansfontoptions = [
|
||||
]
|
||||
# You can get these fonts here: https://fonts.google.com/selection?query=noto+color+
|
||||
monofont = "Noto Sans Mono"
|
||||
mainfontfallback = ["Noto Color Emoji:mode=harf"]
|
||||
sansfontfallback = ["Noto Color Emoji:mode=harf"]
|
||||
mainfontfallback = ["Open Sans"]
|
||||
sansfontfallback = ["Open Sans"]
|
||||
monofontfallback = [
|
||||
"Noto Color Emoji:mode=harf",
|
||||
]
|
||||
@@ -90,8 +90,8 @@ sansfontoptions = [
|
||||
]
|
||||
# You can get these fonts here: https://fonts.google.com/selection?query=noto+color+
|
||||
monofont = "Noto Sans Mono"
|
||||
mainfontfallback = ["Noto Color Emoji:mode=harf"]
|
||||
sansfontfallback = ["Noto Color Emoji:mode=harf"]
|
||||
mainfontfallback = ["Open Sans"]
|
||||
sansfontfallback = ["Open Sans"]
|
||||
monofontfallback = [
|
||||
"Noto Color Emoji:mode=harf",
|
||||
]
|
||||
@@ -121,8 +121,8 @@ metadata-file = "metadata.yml"
|
||||
[output.pandoc.profile.html.variables]
|
||||
# You can get these fonts here: https://fonts.google.com/selection?query=noto+color+
|
||||
monofont = "Noto Sans Mono"
|
||||
mainfontfallback = ["Noto Color Emoji:mode=harf"]
|
||||
sansfontfallback = ["Noto Color Emoji:mode=harf"]
|
||||
mainfontfallback = ["Open Sans"]
|
||||
sansfontfallback = ["Open Sans"]
|
||||
monofontfallback = [
|
||||
"Noto Color Emoji:mode=harf",
|
||||
]
|
||||
|
||||
@@ -69,12 +69,18 @@ You may be wondering—what is a profile setting? Let's get into that!
|
||||
A [**profile**](https://doc.rust-lang.org/cargo/reference/profiles.html) is a set of configuration options that can be
|
||||
used to customize the way Rust code is compiled.
|
||||
|
||||
Cargo provides two built-in profiles: `dev` and `release`.\
|
||||
Cargo provides 4 built-in profiles: `dev`, `release`, `test`, and `bench`.\
|
||||
The `dev` profile is used every time you run `cargo build`, `cargo run` or `cargo test`. It's aimed at local
|
||||
development,
|
||||
therefore it sacrifices runtime performance in favor of faster compilation times and a better debugging experience.\
|
||||
The `release` profile, instead, is optimized for runtime performance but incurs longer compilation times. You need
|
||||
to explicitly request via the `--release` flag—e.g. `cargo build --release` or `cargo run --release`.
|
||||
The `test` profile is the default profile used by `cargo test`. The `test` profile inherits the settings form the `dev` profile.
|
||||
The `bench` profile is the default profile used by `cargo bench`. The `bench` profile inherits from the `release` profile.
|
||||
Use `dev` for iterative development and debugging, `release` for optimized production builds,\
|
||||
`test` for correctness testing, and `bench` for performance benchmarking.
|
||||
|
||||
|
||||
|
||||
> "Have you built your project in release mode?" is almost a meme in the Rust community.\
|
||||
> It refers to developers who are not familiar with Rust and complain about its performance on
|
||||
|
||||
@@ -19,7 +19,7 @@ mod tests {
|
||||
// 👇 With the `#[should_panic]` annotation we can assert that we expect the code
|
||||
// under test to panic. We can also check the panic message by using `expected`.
|
||||
// This is all part of Rust's built-in test framework!
|
||||
#[should_panic(expected = "The journey took no time at all, that's impossible!")]
|
||||
#[should_panic(expected = "The journey took no time at all. That's impossible!")]
|
||||
fn by_zero() {
|
||||
speed(0, 10, 0);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ mod tests {
|
||||
|
||||
// You could solve this by using exactly the same expression as above,
|
||||
// but that would defeat the purpose of the exercise. Instead, use a genuine
|
||||
// `i8` value that is equivalent to `255` when converted from `u8`.
|
||||
// `i8` value that is equivalent to `255` when converted to `u8`.
|
||||
let y: i8 = todo!();
|
||||
|
||||
assert_eq!(x, y);
|
||||
|
||||
Reference in New Issue
Block a user