clippy
11 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 11 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.79.0 (129f3b996 2024-06-10)
- cargo 1.79.0 (ffa9cf99a 2024-06-03)
- clippy 0.1.79 (129f3b9 2024-06-10)
Annotations
Check warning on line 148 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:139:5
|
139 | / pub fn new(
140 | | front_matter: FrontMatter,
141 | | excerpt: Option<String>,
142 | | content: String,
... |
147 | | ancestor_directories_names: Vec<String>,
148 | | ) -> 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 281 in src/content.rs
github-actions / clippy
comparison to empty slice
warning: comparison to empty slice
--> src/content.rs:281:20
|
281 | 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 254 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:254:27
|
254 | 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
|
254 - pub fn get_posts_per_tags<'a>(posts: &'a [Post]) -> HashMap<String, Vec<&'a Post>> {
254 + pub fn get_posts_per_tags(posts: &[Post]) -> HashMap<String, Vec<&Post>> {
|
Check warning on line 245 in src/content.rs
github-actions / clippy
unnecessary use of `to_string`
warning: unnecessary use of `to_string`
--> src/content.rs:245:21
|
245 | 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 195 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:195:13
|
195 | &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 75 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:75:9
|
75 | &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 74 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:74:9
|
74 | &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 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.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 67 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:67:9
|
67 | &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 174 in src/config/markup.rs
github-actions / clippy
assigning the result of `ToOwned::to_owned()` may be inefficient
warning: assigning the result of `ToOwned::to_owned()` may be inefficient
--> src/config/markup.rs:174:13
|
174 | target = "target=\"_blank\" ".to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `"target=\"_blank\" ".clone_into(&mut target)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
Check warning on line 291 in src/content.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> src/content.rs:281:17
|
281 | / if dir_index != "" {
282 | | if site
283 | | .settings
284 | | .create_index_for
... |
290 | | }
291 | | }
| |_________________^
|
= 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
|
281 ~ if dir_index != "" && site
282 + .settings
283 + .create_index_for
284 + .contains(&dir_index.to_string()) {
285 + let key = dir_index.to_string();
286 + let posts = indexes_to_create.entry(key).or_default();
287 + posts.push(post);
288 + }
|