-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adds a new 'clippy' category for exercises - clippy exercises should throw no warnings - install script now also installs clippy is related to rust-lang/rust-clippy#2604
- Loading branch information
Showing
10 changed files
with
110 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
target/ | ||
**/*.rs.bk | ||
.DS_Store | ||
*.pdb | ||
*.pdb | ||
exercises/clippy/Cargo.toml | ||
exercises/clippy/Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### Clippy | ||
|
||
The Clippy tool is a collection of lints to analyze your code so you can catch common mistakes and improve your Rust code. | ||
|
||
If you used the installation script for Rustlings, Clippy should be already installed. | ||
If not you can install it manually via `rustup component add clippy`. | ||
|
||
For more information about Clippy lints, please see [their documentation page](https://rust-lang.github.io/rust-clippy/master/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// clippy1.rs | ||
// The Clippy tool is a collection of lints to analyze your code | ||
// so you can catch common mistakes and improve your Rust code. | ||
// | ||
// Execute `rustlings hint clippy1` for hints :) | ||
|
||
// I AM NOT DONE | ||
|
||
fn main() { | ||
let x = 1.2331f64; | ||
let y = 1.2332f64; | ||
if y != x { | ||
println!("Success!"); | ||
} | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Tarnadas
Author
Contributor
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// clippy2.rs | ||
// Make me compile! Execute `rustlings hint clippy2` for hints :) | ||
|
||
// I AM NOT DONE | ||
|
||
fn main() { | ||
let mut res = 42; | ||
let option = Some(12); | ||
for x in option { | ||
res += x; | ||
} | ||
println!("{}", res); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Tarnadas What's the intent of this exercise? I agree we should not be comparing against two floats, but I'm not quite following what the solution should be.