Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy updates #1792

Merged
merged 2 commits into from Jan 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -26,7 +26,7 @@ Running this command will reformat all of the Rust code in the current crate.
This should only change the code style, not the code semantics. For more
information on `rustfmt`, see [its documentation][rustfmt].

[rustfmt]: https://github.com/rust-lang-nursery/rustfmt
[rustfmt]: https://github.com/rust-lang/rustfmt

## Fix Up Your Code with `rustfix`

@@ -100,14 +100,10 @@ different editions of Rust. Editions are covered in Appendix E.
The `clippy` tool is a collection of lints to catch common mistakes and improve
your Rust code.

The `clippy` tool is not yet at the quality of a version 1.0 release, but a
preview is available for you to use in the meantime. Please give it a try and
let us know how it goes!

To install `clippy`:

```text
$ rustup component add clippy-preview
$ rustup component add clippy
```

To take any Cargo project and run clippy’s lints on it:
@@ -139,7 +135,7 @@ error: approximate value of `f{32, 64}::consts::PI` found. Consider using it dir
| ^^^^^^
|
= note: #[deny(clippy::approx_constant)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#approx_constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/v0.0.212/index.html#approx_constant
```

This lets you know that Rust has this constant defined more precisely, and that
@@ -158,7 +154,7 @@ fn main() {

For more information on `clippy`, see [its documentation][clippy].

[clippy]: https://github.com/rust-lang-nursery/rust-clippy
[clippy]: https://github.com/rust-lang/rust-clippy

## IDE Integration Using the Rust Language Server

@@ -182,4 +178,4 @@ gain abilities such as autocompletion, jump to definition, and inline errors.

For more information on the `rls`, see [its documentation][rls].

[rls]: https://github.com/rust-lang-nursery/rls
[rls]: https://github.com/rust-lang/rls