fix: conform.nvim config #100
clippy
13 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 13 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.80.1 (3f5fd8dd4 2024-08-06)
- cargo 1.80.1 (376290515 2024-07-16)
- clippy 0.1.80 (3f5fd8d 2024-08-06)
Annotations
Check warning on line 42 in src/slugify.rs
github-actions / clippy
useless conversion to the same type: `std::string::String`
warning: useless conversion to the same type: `std::string::String`
--> src/slugify.rs:38:9
|
38 | / match *i {
39 | | 0 => anchor,
40 | | i => format!("{}-{}", anchor, i),
41 | | }
42 | | .into()
| |_______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
help: consider removing `.into()`
|
38 ~ match *i {
39 + 0 => anchor,
40 + i => format!("{}-{}", anchor, i),
41 + }
|
Check warning on line 149 in src/post.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> src/post.rs:140:5
|
140 | / pub fn new(
141 | | front_matter: FrontMatter,
142 | | excerpt: Option<String>,
143 | | content: String,
... |
148 | | ancestor_directories_names: Vec<String>,
149 | | ) -> Self {
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
Check warning on line 103 in src/markdown.rs
github-actions / clippy
useless conversion to the same type: `std::option::Option<pulldown_cmark::CowStr<'_>>`
warning: useless conversion to the same type: `std::option::Option<pulldown_cmark::CowStr<'_>>`
--> src/markdown.rs:103:29
|
103 | id: id.clone().or(Some(slug.clone().into())).into(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `id.clone().or(Some(slug.clone().into()))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 241 in src/content.rs
github-actions / clippy
comparison to empty slice
warning: comparison to empty slice
--> src/content.rs:241:20
|
241 | if dir_index != "" {
| ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!dir_index.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
= note: `#[warn(clippy::comparison_to_empty)]` on by default
Check warning on line 214 in src/content.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/content.rs:214:27
|
214 | pub fn get_posts_per_tags<'a>(posts: &'a [Post]) -> HashMap<String, Vec<&'a Post>> {
| ^^ ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
214 - pub fn get_posts_per_tags<'a>(posts: &'a [Post]) -> HashMap<String, Vec<&'a Post>> {
214 + pub fn get_posts_per_tags(posts: &[Post]) -> HashMap<String, Vec<&Post>> {
|
Check warning on line 205 in src/content.rs
github-actions / clippy
unnecessary use of `to_string`
warning: unnecessary use of `to_string`
--> src/content.rs:205:21
|
205 | slugify(tag.to_string())
| ^^^^^^^^^^^^^^^ help: use: `tag`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
Check warning on line 142 in src/content.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/content.rs:142:13
|
142 | &post,
| ^^^^^ help: change this to: `post`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 73 in src/content.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/content.rs:73:9
|
73 | &site.settings.website_title.as_str(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `site.settings.website_title.as_str()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 72 in src/content.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/content.rs:72:9
|
72 | &site.settings.author.as_str(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `site.settings.author.as_str()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 71 in src/content.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/content.rs:71:9
|
71 | &site.settings.base_url.as_str(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `site.settings.base_url.as_str()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 65 in src/content.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/content.rs:65:9
|
65 | &site.settings.base_url.as_str(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `site.settings.base_url.as_str()`
|
= 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 67 in src/markdown.rs
github-actions / clippy
this `else { if .. }` block can be collapsed
warning: this `else { if .. }` block can be collapsed
--> src/markdown.rs:59:24
|
59 | } else {
| ________________________^
60 | | if let Some(ref mut code_block) = code_block {
61 | | let html = code_block.highlight(&text);
62 | | events.push(Event::Html(html.into()));
... |
66 | | }
67 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
59 ~ } else if let Some(ref mut code_block) = code_block {
60 + let html = code_block.highlight(&text);
61 + events.push(Event::Html(html.into()));
62 + } else {
63 + events.push(Event::Text(text));
64 + continue;
65 + }
|
Check warning on line 251 in src/content.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> src/content.rs:241:17
|
241 | / if dir_index != "" {
242 | | if site
243 | | .settings
244 | | .create_index_for
... |
250 | | }
251 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
241 ~ if dir_index != "" && site
242 + .settings
243 + .create_index_for
244 + .contains(&dir_index.to_string()) {
245 + let key = dir_index.to_string();
246 + let posts = indexes_to_create.entry(key).or_default();
247 + posts.push(post);
248 + }
|