Update LICENSE #38
clippy
22 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 22 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.1 (7cf61ebde 2024-03-27)
- cargo 1.77.1 (e52e36006 2024-03-26)
- clippy 0.1.77 (7cf61eb 2024-03-27)
Annotations
Check warning on line 162 in src/utils.rs
github-actions / clippy
single-character string constant used as pattern
warning: single-character string constant used as pattern
--> src/utils.rs:162:31
|
162 | result = result.split("/").next().unwrap()
| ^^^ help: consider using a `char`: `'/'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
Check warning on line 161 in src/utils.rs
github-actions / clippy
single-character string constant used as pattern
warning: single-character string constant used as pattern
--> src/utils.rs:161:24
|
161 | if result.contains("/") {
| ^^^ help: consider using a `char`: `'/'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` on by default
Check warning on line 110 in src/utils.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/utils.rs:110:5
|
110 | return (fetch_file(user_input, &tmp_path).unwrap_or(tmp_path), true);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
110 - return (fetch_file(user_input, &tmp_path).unwrap_or(tmp_path), true);
110 + (fetch_file(user_input, &tmp_path).unwrap_or(tmp_path), true)
|
Check warning on line 145 in src/utils.rs
github-actions / clippy
function `extract_netloc` is never used
warning: function `extract_netloc` is never used
--> src/utils.rs:145:8
|
145 | pub fn extract_netloc(data: &String) -> String {
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 611 in src/lib.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/lib.rs:611:43
|
611 | let fline = utils::extract_netloc(&line);
| ^^^^^ help: change this to: `line`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
Check warning on line 420 in src/lib.rs
github-actions / clippy
unneeded late initialization
warning: unneeded late initialization
--> src/lib.rs:420:9
|
420 | let record: String;
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `record` here
|
422 | let record: String = if self.settings.handle_complement && line.starts_with("www.") {
| ++++++++++++++++++++
help: remove the assignments from the branches
|
423 ~ line.replacen("www.", "", 1).trim().to_string()
424 | } else {
425 ~ line.to_string()
|
help: add a semicolon after the `if` expression
|
426 | };
| +
Check warning on line 403 in src/lib.rs
github-actions / clippy
writing `&String` instead of `&str` involves a new object where a slice will do
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/lib.rs:403:39
|
403 | fn unparse_regex(&mut self, line: &String) -> bool {
| ^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 387 in src/lib.rs
github-actions / clippy
writing `&String` instead of `&str` involves a new object where a slice will do
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/lib.rs:387:37
|
387 | fn parse_regex(&mut self, line: &String) -> bool {
| ^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 357 in src/lib.rs
github-actions / clippy
writing `&String` instead of `&str` involves a new object where a slice will do
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/lib.rs:357:46
|
357 | fn unparse_root_zone_db(&mut self, line: &String) -> bool {
| ^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 327 in src/lib.rs
github-actions / clippy
writing `&String` instead of `&str` involves a new object where a slice will do
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/lib.rs:327:44
|
327 | fn parse_root_zone_db(&mut self, line: &String) -> bool {
| ^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 315 in src/lib.rs
github-actions / clippy
`to_string` applied to a type that implements `Display` in `format!` args
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/lib.rs:315:57
|
315 | self.pull_strict(&format!("www.{}", record[1..].to_string()));
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&record[1..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
Check warning on line 315 in src/lib.rs
github-actions / clippy
stripping a prefix manually
warning: stripping a prefix manually
--> src/lib.rs:315:57
|
315 | self.pull_strict(&format!("www.{}", record[1..].to_string()));
| ^^^^^^^^^^^
|
note: the prefix was tested here
--> src/lib.rs:312:9
|
312 | if record.starts_with('.') {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
help: try using the `strip_prefix` method
|
312 ~ if let Some(<stripped>) = record.strip_prefix('.') {
313 | if record.matches('.').count() > 1 {
314 | if self.settings.handle_complement {
315 ~ self.pull_strict(&format!("www.{}", <stripped>.to_string()));
316 | }
317 ~ self.pull_strict(&<stripped>.to_string());
|
Check warning on line 301 in src/lib.rs
github-actions / clippy
writing `&String` instead of `&str` involves a new object where a slice will do
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/lib.rs:301:37
|
301 | fn unparse_all(&mut self, line: &String) -> bool {
| ^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 289 in src/lib.rs
github-actions / clippy
`to_string` applied to a type that implements `Display` in `format!` args
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/lib.rs:289:57
|
289 | self.push_strict(&format!("www.{}", record[1..].to_string()));
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&record[1..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
= note: `#[warn(clippy::to_string_in_format_args)]` on by default
Check warning on line 289 in src/lib.rs
github-actions / clippy
stripping a prefix manually
warning: stripping a prefix manually
--> src/lib.rs:289:57
|
289 | self.push_strict(&format!("www.{}", record[1..].to_string()));
| ^^^^^^^^^^^
|
note: the prefix was tested here
--> src/lib.rs:286:9
|
286 | if record.starts_with('.') {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
help: try using the `strip_prefix` method
|
286 ~ if let Some(<stripped>) = record.strip_prefix('.') {
287 | if record.matches('.').count() > 1 {
288 | if self.settings.handle_complement {
289 ~ self.push_strict(&format!("www.{}", <stripped>.to_string()));
290 | }
291 ~ self.push_strict(&<stripped>.to_string());
|
Check warning on line 275 in src/lib.rs
github-actions / clippy
writing `&String` instead of `&str` involves a new object where a slice will do
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/lib.rs:275:35
|
275 | fn parse_all(&mut self, line: &String) -> bool {
| ^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 152 in src/lib.rs
github-actions / clippy
writing `&String` instead of `&str` involves a new object where a slice will do
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/lib.rs:152:39
|
152 | fn search_keys(&mut self, record: &String) -> (String, String) {
| ^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
Check warning on line 132 in src/lib.rs
github-actions / clippy
stripping a prefix manually
warning: stripping a prefix manually
--> src/lib.rs:132:22
|
132 | result = element[4..].to_string()
| ^^^^^^^^^^^^
|
note: the prefix was tested here
--> src/lib.rs:131:9
|
131 | if element.starts_with("www.") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
= note: `#[warn(clippy::manual_strip)]` on by default
help: try using the `strip_prefix` method
|
131 ~ if let Some(<stripped>) = element.strip_prefix("www.") {
132 ~ result = <stripped>.to_string()
|
Check warning on line 129 in src/lib.rs
github-actions / clippy
unneeded late initialization
warning: unneeded late initialization
--> src/lib.rs:129:9
|
129 | let result;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: declare `result` here
|
131 | let result = if element.starts_with("www.") {
| ++++++++++++
help: remove the assignments from the branches
|
132 ~ element[4..].to_string()
133 | } else {
134 ~ element.to_string()
|
help: add a semicolon after the `if` expression
|
135 | };
| +
Check warning on line 162 in src/utils.rs
github-actions / clippy
single-character string constant used as pattern
warning: single-character string constant used as pattern
--> src/utils.rs:162:31
|
162 | result = result.split("/").next().unwrap()
| ^^^ help: consider using a `char`: `'/'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
Check warning on line 161 in src/utils.rs
github-actions / clippy
single-character string constant used as pattern
warning: single-character string constant used as pattern
--> src/utils.rs:161:24
|
161 | if result.contains("/") {
| ^^^ help: consider using a `char`: `'/'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` on by default
Check warning on line 110 in src/utils.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/utils.rs:110:5
|
110 | return (fetch_file(user_input, &tmp_path).unwrap_or(tmp_path), true);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
110 - return (fetch_file(user_input, &tmp_path).unwrap_or(tmp_path), true);
110 + (fetch_file(user_input, &tmp_path).unwrap_or(tmp_path), true)
|