rust-cli / book

Documentation on how to use the Rust Programming Language to develop commandline applications
https://rust-cli.github.io/book/index.html
MIT License
816 stars 108 forks source link

[Mistake, please ignore] #221

Closed timdhoffmann closed 1 year ago

timdhoffmann commented 1 year ago

Update: Sorry, my bad! I just realized that the test is matching against the custom anyhow error, that has been defined in main.rs. I diverged from the tutorial's capitalization in my code and only realized it now.

Fixes the file_doesnt_exist test, which fails with latest rustc due to a mismatch in capitalization. It seems like the CI tests on this repo utilize an outdate rustc version:

https://github.com/rust-cli/book/actions/runs/5193164845/jobs/9363445982?pr=221#step:3:13

rustc 1.69.0 (84c898d65 2023-04-16)

Rust generates the following error for this test with a capital C:

Error: Could not read file \'test/file/doesnt/exist\'

while the test is looking for a match against the string "could not read file", with a minuscule c.

Tests

❯ rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.70.0 (90c541806 2023-05-31)`

❯ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)

Before fix:

image

After fix:

image

PS: Thank you for this awesome resource!