Skip to content

Commit 4bcd103

Browse files
authored
ssh-key: clippy fixups (#447)
1 parent 38545f5 commit 4bcd103

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

.github/workflows/workspace.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v6
2222
- uses: dtolnay/rust-toolchain@stable
2323
with:
24-
toolchain: 1.89 # pinned to prevent breakages when new rust versions are released
24+
toolchain: 1.92 # pinned to prevent breakages when new rust versions are released
2525
components: clippy
2626
- run: cargo clippy --all-features
2727

ssh-key/src/certificate/cert_type.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ use encoding::{Decode, Encode, Reader, Writer};
66
/// Types of OpenSSH certificates: user or host.
77
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
88
#[repr(u32)]
9+
#[derive(Default)]
910
pub enum CertType {
1011
/// User certificate
12+
#[default]
1113
User = 1,
1214

1315
/// Host certificate
@@ -26,12 +28,6 @@ impl CertType {
2628
}
2729
}
2830

29-
impl Default for CertType {
30-
fn default() -> Self {
31-
Self::User
32-
}
33-
}
34-
3531
impl Decode for CertType {
3632
type Error = Error;
3733

ssh-key/src/fingerprint/randomart.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ pub(super) struct Randomart<'a> {
2525

2626
impl<'a> Randomart<'a> {
2727
/// Create new "randomart" from the given fingerprint.
28-
// TODO: Remove this when the pipeline toolchain is updated beyond 1.69
29-
#[allow(clippy::arithmetic_side_effects)]
3028
pub(super) fn new(header: &'a str, fingerprint: Fingerprint) -> Self {
3129
let mut field = Field::default();
3230
let mut x = WIDTH / 2;

ssh-key/src/kdf.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ const DEFAULT_SALT_SIZE: usize = 16;
2222
/// Key Derivation Functions (KDF).
2323
#[derive(Clone, Debug, Eq, PartialEq)]
2424
#[non_exhaustive]
25+
#[derive(Default)]
2526
pub enum Kdf {
2627
/// No KDF.
28+
#[default]
2729
None,
2830

2931
/// bcrypt-pbkdf options.
@@ -124,12 +126,6 @@ impl Kdf {
124126
}
125127
}
126128

127-
impl Default for Kdf {
128-
fn default() -> Self {
129-
Self::None
130-
}
131-
}
132-
133129
impl Decode for Kdf {
134130
type Error = Error;
135131

0 commit comments

Comments
 (0)