Skip to content

Commit 864471f

Browse files
committed
rustfmt: style_edition 2024
1 parent e7c38ac commit 864471f

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

rustfmt.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style_edition = "2024"

src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl PrivatePkcs1KeyDer<'_> {
327327
#[cfg(feature = "alloc")]
328328
impl zeroize::Zeroize for PrivatePkcs1KeyDer<'static> {
329329
fn zeroize(&mut self) {
330-
self.0 .0.zeroize()
330+
self.0.0.zeroize()
331331
}
332332
}
333333

@@ -394,7 +394,7 @@ impl PrivateSec1KeyDer<'_> {
394394
#[cfg(feature = "alloc")]
395395
impl zeroize::Zeroize for PrivateSec1KeyDer<'static> {
396396
fn zeroize(&mut self) {
397-
self.0 .0.zeroize()
397+
self.0.0.zeroize()
398398
}
399399
}
400400

@@ -462,7 +462,7 @@ impl PrivatePkcs8KeyDer<'_> {
462462
#[cfg(feature = "alloc")]
463463
impl zeroize::Zeroize for PrivatePkcs8KeyDer<'static> {
464464
fn zeroize(&mut self) {
465-
self.0 .0.zeroize()
465+
self.0.0.zeroize()
466466
}
467467
}
468468

@@ -714,7 +714,7 @@ impl CertificateDer<'_> {
714714
/// Converts this certificate into its owned variant, unfreezing borrowed content (if any)
715715
#[cfg(feature = "alloc")]
716716
pub fn into_owned(self) -> CertificateDer<'static> {
717-
CertificateDer(Der(self.0 .0.into_owned()))
717+
CertificateDer(Der(self.0.0.into_owned()))
718718
}
719719
}
720720

@@ -777,7 +777,7 @@ impl SubjectPublicKeyInfoDer<'_> {
777777
/// Converts this SubjectPublicKeyInfo into its owned variant, unfreezing borrowed content (if any)
778778
#[cfg(feature = "alloc")]
779779
pub fn into_owned(self) -> SubjectPublicKeyInfoDer<'static> {
780-
SubjectPublicKeyInfoDer(Der(self.0 .0.into_owned()))
780+
SubjectPublicKeyInfoDer(Der(self.0.0.into_owned()))
781781
}
782782
}
783783

src/server_name.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,14 @@ const fn validate(input: &[u8]) -> Result<(), InvalidDnsNameError> {
335335
let ch = input[idx];
336336
state = match (state, ch) {
337337
(Start | Next | NextAfterNumericOnly | Hyphen { .. }, b'.') => {
338-
return Err(InvalidDnsNameError)
338+
return Err(InvalidDnsNameError);
339339
}
340340
(Subsequent { .. }, b'.') => Next,
341341
(NumericOnly { .. }, b'.') => NextAfterNumericOnly,
342342
(Subsequent { len } | NumericOnly { len } | Hyphen { len }, _)
343343
if len >= MAX_LABEL_LENGTH =>
344344
{
345-
return Err(InvalidDnsNameError)
345+
return Err(InvalidDnsNameError);
346346
}
347347
(Start | Next | NextAfterNumericOnly, b'0'..=b'9') => NumericOnly { len: 1 },
348348
(NumericOnly { len }, b'0'..=b'9') => NumericOnly { len: len + 1 },
@@ -837,8 +837,14 @@ mod tests {
837837
("a123b.com", true),
838838
("numeric-only-middle-label.4.com", true),
839839
("1000-sans.badssl.com", true),
840-
("twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfi", true),
841-
("twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourc", false),
840+
(
841+
"twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfiftythreecharacters.twohundredandfi",
842+
true,
843+
),
844+
(
845+
"twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourcharacters.twohundredandfiftyfourc",
846+
false,
847+
),
842848
];
843849

844850
#[cfg(feature = "alloc")]

tests/pem.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use std::io::Cursor;
44

55
use rustls_pki_types::pem::PemObject;
66
use rustls_pki_types::{
7-
pem, CertificateDer, CertificateRevocationListDer, CertificateSigningRequestDer,
8-
EchConfigListBytes, PrivateKeyDer, PrivatePkcs1KeyDer, PrivatePkcs8KeyDer, PrivateSec1KeyDer,
9-
SubjectPublicKeyInfoDer,
7+
CertificateDer, CertificateRevocationListDer, CertificateSigningRequestDer, EchConfigListBytes,
8+
PrivateKeyDer, PrivatePkcs1KeyDer, PrivatePkcs8KeyDer, PrivateSec1KeyDer,
9+
SubjectPublicKeyInfoDer, pem,
1010
};
1111

1212
#[test]

0 commit comments

Comments
 (0)