clippy
7 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 7 |
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 85 in metassr-cli/src/cli.rs
github-actions / clippy
useless use of `format!`
warning: useless use of `format!`
--> metassr-cli/src/cli.rs:79:22
|
79 | f.write_str(&format!(
| ______________________^
80 | | "{}",
81 | | match *self {
82 | | Self::SSG => "ssg",
83 | | Self::SSR => "ssr",
84 | | }
85 | | ))
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
help: consider using `.to_string()`
|
79 ~ f.write_str(&(match *self {
80 + Self::SSG => "ssg",
81 + Self::SSR => "ssr",
82 ~ }).to_string())
|
Check warning on line 68 in metassr-cli/src/cli.rs
github-actions / clippy
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> metassr-cli/src/cli.rs:68:1
|
68 | impl Into<server::BuildingType> for BuildingType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<cli::BuildingType>`
|
68 ~ impl From<BuildingType> for server::BuildingType {
69 ~ fn from(val: BuildingType) -> Self {
70 ~ match val {
71 ~ BuildingType::SSG => server::BuildingType::StaticSiteGeneration,
72 ~ BuildingType::SSR => server::BuildingType::ServerSideRendering,
|
Check warning on line 65 in metassr-cli/src/cli.rs
github-actions / clippy
name `SSR` contains a capitalized acronym
warning: name `SSR` contains a capitalized acronym
--> metassr-cli/src/cli.rs:65:5
|
65 | SSR,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Ssr`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
Check warning on line 63 in metassr-cli/src/cli.rs
github-actions / clippy
name `SSG` contains a capitalized acronym
warning: name `SSG` contains a capitalized acronym
--> metassr-cli/src/cli.rs:63:5
|
63 | SSG,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Ssg`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
= note: `#[warn(clippy::upper_case_acronyms)]` on by default
Check warning on line 14 in crates/metassr-utils/src/rand.rs
github-actions / clippy
you should consider adding a `Default` implementation for `Rand`
warning: you should consider adding a `Default` implementation for `Rand`
--> crates/metassr-utils/src/rand.rs:11:5
|
11 | / pub fn new() -> Self {
12 | | let val = RandomState::new().build_hasher().finish() as i64;
13 | | Self(val.abs())
14 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
10 + impl Default for Rand {
11 + fn default() -> Self {
12 + Self::new()
13 + }
14 + }
|
Check warning on line 19 in crates/html-generator/src/html_props.rs
github-actions / clippy
methods called `new` usually return `Self`
warning: methods called `new` usually return `Self`
--> crates/html-generator/src/html_props.rs:17:5
|
17 | / pub fn new() -> HtmlPropsBuilder {
18 | | HtmlPropsBuilder::new()
19 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self
= note: `#[warn(clippy::new_ret_no_self)]` on by default
Check warning on line 30 in crates/html-generator/src/builder.rs
github-actions / clippy
direct implementation of `ToString`
warning: direct implementation of `ToString`
--> crates/html-generator/src/builder.rs:26:1
|
26 | / impl ToString for HtmlOutput {
27 | | fn to_string(&self) -> String {
28 | | self.0.clone()
29 | | }
30 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: `#[warn(clippy::to_string_trait_impl)]` on by default