Merge pull request #11 from metacall/improve-utils #44
Annotations
22 warnings
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
metassr-cli/src/cli/builder.rs#L66
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> metassr-cli/src/cli/builder.rs:66:1
|
66 | 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::builder::BuildingType>`
|
66 ~ impl From<BuildingType> for server::BuildingType {
67 ~ fn from(val: BuildingType) -> Self {
68 ~ match val {
69 ~ BuildingType::SSG => server::BuildingType::StaticSiteGeneration,
70 ~ BuildingType::SSR => server::BuildingType::ServerSideRendering,
|
|
name `SSR` contains a capitalized acronym:
metassr-cli/src/cli/builder.rs#L63
warning: name `SSR` contains a capitalized acronym
--> metassr-cli/src/cli/builder.rs:63:5
|
63 | 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
|
name `SSG` contains a capitalized acronym:
metassr-cli/src/cli/builder.rs#L61
warning: name `SSG` contains a capitalized acronym
--> metassr-cli/src/cli/builder.rs:61:5
|
61 | 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
|
unused variable: `path`:
crates/metassr-server/src/handler.rs#L49
warning: unused variable: `path`
--> crates/metassr-server/src/handler.rs:49:28
|
49 | Path(path): Path<HashMap<String, String>>| async move {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_path`
|
unused variable: `params`:
crates/metassr-server/src/handler.rs#L48
warning: unused variable: `params`
--> crates/metassr-server/src/handler.rs:48:29
|
48 | move |Query(params): Query<HashMap<String, String>>,
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_params`
|
= note: `#[warn(unused_variables)]` on by default
|
direct implementation of `ToString`:
crates/metassr-create/src/templates.rs#L20
warning: direct implementation of `ToString`
--> crates/metassr-create/src/templates.rs:20:1
|
20 | / impl ToString for Template {
21 | | fn to_string(&self) -> String {
22 | | match *self {
23 | | Self::Javascript => "javascript",
... |
27 | | }
28 | | }
| |_^
|
= 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
|
re-implementing `PartialEq::ne` is unnecessary:
crates/metassr-utils/src/rand.rs#L94
warning: re-implementing `PartialEq::ne` is unnecessary
--> crates/metassr-utils/src/rand.rs:94:5
|
94 | / fn ne(&self, other: &i64) -> bool {
95 | | &self.0 != other
96 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl
|
methods called `new` usually return `Self`:
crates/html-generator/src/html_props.rs#L17
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
|
direct implementation of `ToString`:
crates/html-generator/src/builder.rs#L26
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
|
clippy_check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
clippy_check
The following actions use a deprecated Node.js version and will be forced to run on node20: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
metassr-cli/src/cli/builder.rs#L66
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> metassr-cli/src/cli/builder.rs:66:1
|
66 | 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::builder::BuildingType>`
|
66 ~ impl From<BuildingType> for server::BuildingType {
67 ~ fn from(val: BuildingType) -> Self {
68 ~ match val {
69 ~ BuildingType::SSG => server::BuildingType::StaticSiteGeneration,
70 ~ BuildingType::SSR => server::BuildingType::ServerSideRendering,
|
|
name `SSR` contains a capitalized acronym:
metassr-cli/src/cli/builder.rs#L63
warning: name `SSR` contains a capitalized acronym
--> metassr-cli/src/cli/builder.rs:63:5
|
63 | 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
|
name `SSG` contains a capitalized acronym:
metassr-cli/src/cli/builder.rs#L61
warning: name `SSG` contains a capitalized acronym
--> metassr-cli/src/cli/builder.rs:61:5
|
61 | 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
|
unused variable: `path`:
crates/metassr-server/src/handler.rs#L49
warning: unused variable: `path`
--> crates/metassr-server/src/handler.rs:49:28
|
49 | Path(path): Path<HashMap<String, String>>| async move {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_path`
|
unused variable: `params`:
crates/metassr-server/src/handler.rs#L48
warning: unused variable: `params`
--> crates/metassr-server/src/handler.rs:48:29
|
48 | move |Query(params): Query<HashMap<String, String>>,
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_params`
|
= note: `#[warn(unused_variables)]` on by default
|
direct implementation of `ToString`:
crates/metassr-create/src/templates.rs#L20
warning: direct implementation of `ToString`
--> crates/metassr-create/src/templates.rs:20:1
|
20 | / impl ToString for Template {
21 | | fn to_string(&self) -> String {
22 | | match *self {
23 | | Self::Javascript => "javascript",
... |
27 | | }
28 | | }
| |_^
|
= 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
|
re-implementing `PartialEq::ne` is unnecessary:
crates/metassr-utils/src/rand.rs#L94
warning: re-implementing `PartialEq::ne` is unnecessary
--> crates/metassr-utils/src/rand.rs:94:5
|
94 | / fn ne(&self, other: &i64) -> bool {
95 | | &self.0 != other
96 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl
|
re-implementing `PartialEq::ne` is unnecessary:
crates/metassr-utils/src/rand.rs#L66
warning: re-implementing `PartialEq::ne` is unnecessary
--> crates/metassr-utils/src/rand.rs:66:5
|
66 | / fn ne(&self, other: &Self) -> bool {
67 | | self.0 != other.0
68 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl
= note: `#[warn(clippy::partialeq_ne_impl)]` on by default
|
you should consider adding a `Default` implementation for `Rand`:
crates/metassr-utils/src/rand.rs#L36
warning: you should consider adding a `Default` implementation for `Rand`
--> crates/metassr-utils/src/rand.rs:36:5
|
36 | / pub fn new() -> Self {
37 | | let val = RandomState::new().build_hasher().finish() as i64; // Generate a random value
38 | | Self(val.abs()) // Ensure the value is non-negative
39 | | }
| |_____^
|
= 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
|
23 + impl Default for Rand {
24 + fn default() -> Self {
25 + Self::new()
26 + }
27 + }
|
|
methods called `new` usually return `Self`:
crates/html-generator/src/html_props.rs#L17
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
|
direct implementation of `ToString`:
crates/html-generator/src/builder.rs#L26
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
|