Lint clippy::manual_string_new
warning clippy::manual_string_new §
warning clippy::manual_string_new §
Targets (1)
cargo-clippy-html (bin)
Primary: src/render/search.rs:173:22
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#manual_string_new
note: `-W clippy::manual-string-new` implied by `-W clippy::pedantic`
help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_string_new)]`
help: consider using
Suggestion: consider using
--- "a/src/render/search.rs"
+++ "b/src/render/search.rs"
@@ -170,7 +170,7 @@
let encoded = script(&[Entry {
kind: "finding".into(),
name: text.into(),
- context: "".into(),
+ context: String::new(),
description: "".into(),
href: "index.html".into(),
}])
Rendered diagnostic (text)
warning: empty String is being created manually
--> src/render/search.rs:173:22
|
173 | context: "".into(),
| ^^^^^^^^^ help: consider using: `String::new()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#manual_string_new
= note: `-W clippy::manual-string-new` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_string_new)]`
warning clippy::manual_string_new §
warning clippy::manual_string_new §
Targets (1)
cargo-clippy-html (bin)
Primary: src/render/search.rs:174:26
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#manual_string_new
help: consider using
Suggestion: consider using
--- "a/src/render/search.rs"
+++ "b/src/render/search.rs"
@@ -171,7 +171,7 @@
kind: "finding".into(),
name: text.into(),
context: "".into(),
- description: "".into(),
+ description: String::new(),
href: "index.html".into(),
}])
.unwrap();
Rendered diagnostic (text)
warning: empty String is being created manually
--> src/render/search.rs:174:26
|
174 | description: "".into(),
| ^^^^^^^^^ help: consider using: `String::new()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#manual_string_new