Skip to content

fix: lint error for Default impl#79

Merged
Xynnn007 merged 1 commit into
confidential-containers:mainfrom
Xynnn007:fix-lint
Nov 5, 2025
Merged

fix: lint error for Default impl#79
Xynnn007 merged 1 commit into
confidential-containers:mainfrom
Xynnn007:fix-lint

Conversation

@Xynnn007

@Xynnn007 Xynnn007 commented Nov 5, 2025

Copy link
Copy Markdown
Member

fix error for

warning: this impl can be derived
--> src/hash_algorithm.rs:30:1
|
30 | / impl Default for HashAlgorithm {
31 | | fn default() -> Self {
32 | | Self::Sha384
33 | | }
34 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#derivable_impls
= note: #[warn(clippy::derivable_impls)] on by default
help: replace the manual implementation with a derive attribute and mark the default variant
|
12 + #[derive(Default)]
13 ~ pub enum HashAlgorithm {
14 | #[strum(ascii_case_insensitive)]
...
19 | #[strum(serialize = "sha384")]
20 ~ #[default]
21 ~ Sha384,

fix error for

warning: this `impl` can be derived
  --> src/hash_algorithm.rs:30:1
   |
30 | / impl Default for HashAlgorithm {
31 | |     fn default() -> Self {
32 | |         Self::Sha384
33 | |     }
34 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` on by default
help: replace the manual implementation with a derive attribute and mark the default variant
   |
12 + #[derive(Default)]
13 ~ pub enum HashAlgorithm {
14 |     #[strum(ascii_case_insensitive)]
...
19 |     #[strum(serialize = "sha384")]
20 ~     #[default]
21 ~     Sha384,

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
@Xynnn007 Xynnn007 requested a review from a team as a code owner November 5, 2025 07:49

@mythi mythi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Xynnn007 Xynnn007 merged commit 98985b1 into confidential-containers:main Nov 5, 2025
3 checks passed
@Xynnn007 Xynnn007 deleted the fix-lint branch November 5, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants