Compare commits

..

4 commits

Author SHA1 Message Date
mo8it 0b3ad9141b Add exercise lints 2024-08-16 00:24:45 +02:00
mo8it c903db5c53 Add project lints 2024-08-16 00:24:45 +02:00
Mo 8a038b946c
Merge pull request #2084 from crd477/patch-1
fix typo
2024-08-16 00:12:58 +02:00
Chad Dougherty ed9740b72c
fix typo
Similarely -> Similarly in comment
2024-08-15 14:21:27 -04:00
4 changed files with 33 additions and 2 deletions

View file

@ -69,6 +69,18 @@ panic = "abort"
[package.metadata.release] [package.metadata.release]
pre-release-hook = ["./release-hook.sh"] pre-release-hook = ["./release-hook.sh"]
[workspace.lints.rust]
unsafe_code = "forbid"
unstable_features = "forbid"
[workspace.lints.clippy]
empty_loop = "forbid"
infinite_loop = "deny"
mem_forget = "deny"
dbg_macro = "warn"
todo = "warn"
# TODO: Remove after the following fix is released: https://github.com/rust-lang/rust-clippy/pull/13102 # TODO: Remove after the following fix is released: https://github.com/rust-lang/rust-clippy/pull/13102
[lints.clippy]
needless_option_as_deref = "allow" needless_option_as_deref = "allow"
[lints]
workspace = true

View file

@ -201,3 +201,19 @@ panic = "abort"
[profile.dev] [profile.dev]
panic = "abort" panic = "abort"
[lints.rust]
# You shouldn't write unsafe code in Rustlings
unsafe_code = "forbid"
# You don't need unstable features in Rustlings and shouldn't rely on them while learning Rust
unstable_features = "forbid"
[lints.clippy]
# You forgot a `todo!()`
todo = "forbid"
# This can only happen by mistake in Rustlings
empty_loop = "forbid"
# No infinite loops are needed in Rustlings
infinite_loop = "deny"
# You shouldn't leak memory while still learning Rust
mem_forget = "deny"

View file

@ -19,3 +19,6 @@ proc-macro = true
quote = "1.0.36" quote = "1.0.36"
serde.workspace = true serde.workspace = true
toml_edit.workspace = true toml_edit.workspace = true
[lints]
workspace = true

View file

@ -35,7 +35,7 @@ fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> {
team_1.goals_scored += team_1_score; team_1.goals_scored += team_1_score;
team_1.goals_conceded += team_2_score; team_1.goals_conceded += team_2_score;
// Similarely for the second team. // Similarly for the second team.
let team_2 = scores let team_2 = scores
.entry(team_2_name) .entry(team_2_name)
.or_insert_with(TeamScores::default); .or_insert_with(TeamScores::default);