Skip to content

Commit

Permalink
doc: additional changes to true up documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
canardleteer committed Apr 16, 2024
1 parent f209255 commit 27f65e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions book/src/10-02-code-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ fn main() {
println!("Hello, {}!", args.name);
}
```

- **If you see an inline code warning, ignore the warning.**
4 changes: 3 additions & 1 deletion book/src/10-03-cargo-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ You can declare a whole lot more with `clap`, like commands, sub-commands, etc.

```shell
cargo build

# ignore the compiler warning for now, we will cover that soon.
```

- Run it this way `./target/debug/quickly-explore-rs --help`:

```shell
```text
-> ./target/debug/quickly-explore-rs --help
Usage: quickly-explore-rs [OPTIONS]
Expand Down
13 changes: 7 additions & 6 deletions book/src/10-05-cargo-clippy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- Let's see if the code smells right via `cargo clippy`:

```shell
```text
-> cargo clippy
Checking quickly-explore-rs v0.1.0 (/home/canardleteer/dev/quickly-explore-rs)
warning: unused variable: `name`
Expand All @@ -17,21 +17,22 @@ warning: `quickly-explore-rs` (bin "quickly-explore-rs") generated 1 warning (ru
Finished dev [unoptimized + debuginfo] target(s) in 0.09s
```

Oh yeah, I guess we aren't using `name`. Go ahead and delete that line, or
Oh yeah, I guess we aren't using `name`. Go ahead and: delete that line, or
follow the linters suggestion of prefixing it with an underscore if you want
to use it for something else.

There are 4 other options, which would be to disable linting of that specific rule (`unused_variables`) for:
There are 4 other options, which would be to disable linting of that specific
rule (`unused_variables`) for:

- That line
- That function
- That module
- The whole package

But I won't go into that. The linter isn't always right, but often is. You
have many options that don't involve disabling the linter completely. Don't
disable the linter completely. Not using the linter at all is not a reasonable
5th option.
have many options that don't involve disabling the linter completely. **Don't
disable the linter completely.** Not using the linter at all is not a
reasonable 5th option.

- Run `cargo clippy` again:

Expand Down

0 comments on commit 27f65e6

Please sign in to comment.