Lint clippy::range_plus_one
warning clippy::range_plus_one §
warning clippy::range_plus_one §
Targets (1)
cargo-clippy-html (bin)
Primary: src/render/paths.rs:103:28
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#range_plus_one
note: `-W clippy::range-plus-one` implied by `-W clippy::pedantic`
help: to override `-W clippy::pedantic` add `#[allow(clippy::range_plus_one)]`
help: use
Suggestion: use
--- "a/src/render/paths.rs"
+++ "b/src/render/paths.rs"
@@ -100,7 +100,7 @@
}
if directory && name.to_ascii_lowercase().ends_with(".html") {
let dot = name.len() - 5;
- name.replace_range(dot..dot + 1, "~2E");
+ name.replace_range(dot..=dot, "~2E");
}
while name.ends_with('.') {
name.pop();
Rendered diagnostic (text)
warning: an inclusive range would be more readable
--> src/render/paths.rs:103:28
|
103 | name.replace_range(dot..dot + 1, "~2E");
| ^^^^^^^^^^^^ help: use: `dot..=dot`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#range_plus_one
= note: `-W clippy::range-plus-one` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::range_plus_one)]`