Skip to content

Commit 48ffc60

Browse files
committed
rustfmt: style_edition 2024
1 parent 0310085 commit 48ffc60

File tree

10 files changed

+35
-31
lines changed

10 files changed

+35
-31
lines changed

librustls/src/acceptor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use libc::{c_void, size_t, EINVAL, EIO};
1+
use libc::{EINVAL, EIO, c_void, size_t};
22
use rustls::server::{Accepted, AcceptedAlert, Acceptor};
33

44
use crate::connection::rustls_connection;
@@ -7,7 +7,7 @@ use crate::ffi::{
77
box_castable, free_box, set_boxed_mut_ptr, to_box, to_boxed_mut_ptr, try_callback,
88
try_clone_arc, try_mut_from_ptr, try_mut_from_ptr_ptr, try_ref_from_ptr, try_take,
99
};
10-
use crate::io::{rustls_read_callback, rustls_write_callback, CallbackReader, CallbackWriter};
10+
use crate::io::{CallbackReader, CallbackWriter, rustls_read_callback, rustls_write_callback};
1111
use crate::panic::ffi_panic_boundary;
1212
use crate::rslice::{rustls_slice_bytes, rustls_str};
1313
use crate::server::rustls_server_config;

librustls/src/certificate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use std::ptr::null;
44
use std::slice;
55

66
use libc::{c_char, size_t};
7+
use rustls::RootCertStore;
78
use rustls::pki_types::pem::PemObject;
89
use rustls::pki_types::{CertificateDer, PrivateKeyDer};
910
use rustls::sign::CertifiedKey;
10-
use rustls::RootCertStore;
1111

1212
use crate::crypto_provider::{self, rustls_signing_key};
1313
use crate::error::{map_error, rustls_result};

librustls/src/client.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ use std::sync::Arc;
66
use libc::{c_char, size_t};
77
use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier};
88
use rustls::client::{EchConfig, EchGreaseConfig, EchMode, ResolvesClientCert};
9-
use rustls::crypto::{verify_tls12_signature, verify_tls13_signature, CryptoProvider};
9+
use rustls::crypto::{CryptoProvider, verify_tls12_signature, verify_tls13_signature};
1010
use rustls::pki_types::{CertificateDer, EchConfigListBytes, ServerName, UnixTime};
1111
use rustls::{
12-
sign::CertifiedKey, ClientConfig, ClientConnection, DigitallySignedStruct, Error, KeyLog,
13-
KeyLogFile, ProtocolVersion, SignatureScheme, SupportedProtocolVersion,
12+
ClientConfig, ClientConnection, DigitallySignedStruct, Error, KeyLog, KeyLogFile,
13+
ProtocolVersion, SignatureScheme, SupportedProtocolVersion, sign::CertifiedKey,
1414
};
1515

1616
use crate::certificate::rustls_certified_key;
17-
use crate::connection::{rustls_connection, Connection};
17+
use crate::connection::{Connection, rustls_connection};
1818
use crate::crypto_provider::{self, rustls_crypto_provider, rustls_hpke};
1919
use crate::error::{self, map_error, rustls_result};
2020
use crate::ffi::{
2121
arc_castable, box_castable, free_arc, free_box, set_arc_mut_ptr, set_boxed_mut_ptr,
2222
to_boxed_mut_ptr, try_box_from_ptr, try_clone_arc, try_mut_from_ptr, try_mut_from_ptr_ptr,
2323
try_ref_from_ptr, try_ref_from_ptr_ptr, try_slice,
2424
};
25-
use crate::keylog::{rustls_keylog_log_callback, rustls_keylog_will_log_callback, CallbackKeyLog};
25+
use crate::keylog::{CallbackKeyLog, rustls_keylog_log_callback, rustls_keylog_will_log_callback};
2626
use crate::panic::ffi_panic_boundary;
2727
use crate::rslice::NulByte;
2828
use crate::rslice::{rustls_slice_bytes, rustls_slice_slice_bytes, rustls_str};

librustls/src/connection.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::io::{ErrorKind, Read, Write};
22
use std::{ffi::c_void, ptr::null};
33
use std::{ptr::null_mut, slice};
44

5-
use libc::{size_t, EINVAL, EIO};
6-
use rustls::pki_types::CertificateDer;
5+
use libc::{EINVAL, EIO, size_t};
76
use rustls::CipherSuite::TLS_NULL_WITH_NULL_NULL;
7+
use rustls::pki_types::CertificateDer;
88
use rustls::{ClientConnection, ServerConnection};
99

1010
use crate::certificate::rustls_certificate;
@@ -15,8 +15,8 @@ use crate::ffi::{
1515
try_slice_mut,
1616
};
1717
use crate::io::{
18-
rustls_read_callback, rustls_write_callback, rustls_write_vectored_callback, CallbackReader,
19-
CallbackWriter, VectoredCallbackWriter,
18+
CallbackReader, CallbackWriter, VectoredCallbackWriter, rustls_read_callback,
19+
rustls_write_callback, rustls_write_vectored_callback,
2020
};
2121
use crate::log::{ensure_log_registered, rustls_log_callback};
2222
use crate::panic::ffi_panic_boundary;
@@ -556,10 +556,10 @@ impl rustls_connection {
556556
let n_read = match conn.reader().read(read_buf) {
557557
Ok(n) => n,
558558
Err(e) if e.kind() == ErrorKind::UnexpectedEof => {
559-
return rustls_result::UnexpectedEof
559+
return rustls_result::UnexpectedEof;
560560
}
561561
Err(e) if e.kind() == ErrorKind::WouldBlock => {
562-
return rustls_result::PlaintextEmpty
562+
return rustls_result::PlaintextEmpty;
563563
}
564564
Err(_) => return rustls_result::Io,
565565
};
@@ -601,10 +601,10 @@ impl rustls_connection {
601601
let n_read = match conn.reader().read_buf(read_buf.unfilled()) {
602602
Ok(()) => read_buf.filled().len(),
603603
Err(e) if e.kind() == ErrorKind::UnexpectedEof => {
604-
return rustls_result::UnexpectedEof
604+
return rustls_result::UnexpectedEof;
605605
}
606606
Err(e) if e.kind() == ErrorKind::WouldBlock => {
607-
return rustls_result::PlaintextEmpty
607+
return rustls_result::PlaintextEmpty;
608608
}
609609
Err(_) => return rustls_result::Io,
610610
};

librustls/src/crypto_provider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ use std::sync::Arc;
33

44
use libc::size_t;
55

6+
use rustls::SupportedCipherSuite;
67
#[cfg(feature = "aws-lc-rs")]
78
use rustls::crypto::aws_lc_rs;
89
#[cfg(feature = "ring")]
910
use rustls::crypto::ring;
10-
use rustls::crypto::{hpke, CryptoProvider};
11-
use rustls::pki_types::pem::PemObject;
11+
use rustls::crypto::{CryptoProvider, hpke};
1212
use rustls::pki_types::PrivateKeyDer;
13+
use rustls::pki_types::pem::PemObject;
1314
use rustls::sign::SigningKey;
14-
use rustls::SupportedCipherSuite;
1515

1616
use crate::cipher::rustls_supported_ciphersuite;
1717
use crate::error::{map_error, rustls_result};

librustls/src/error.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,10 @@ impl Display for rustls_result {
532532
write!(f, "an error occurred with the selected HPKE suite")
533533
}
534534
BuilderIncompatibleTlsVersions => {
535-
write!(f, "the client config builder specifies incompatible TLS versions for the requested feature")
535+
write!(
536+
f,
537+
"the client config builder specifies incompatible TLS versions for the requested feature"
538+
)
536539
}
537540

538541
CertEncodingBad => Error::InvalidCertificate(CertificateError::BadEncoding).fmt(f),

librustls/src/rslice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub extern "C" fn rustls_slice_slice_bytes_get(
9797
data: null(),
9898
len: 0,
9999
phantom: PhantomData,
100-
}
100+
};
101101
}
102102
}
103103
};
@@ -329,7 +329,7 @@ pub extern "C" fn rustls_slice_str_get(input: *const rustls_slice_str, n: size_t
329329
data: null(),
330330
len: 0,
331331
phantom: PhantomData,
332-
}
332+
};
333333
}
334334
}
335335
};

librustls/src/server.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ use rustls::sign::CertifiedKey;
1414
use rustls::{KeyLog, KeyLogFile, ProtocolVersion, SignatureScheme, SupportedProtocolVersion};
1515

1616
use crate::certificate::rustls_certified_key;
17-
use crate::connection::{rustls_connection, Connection};
17+
use crate::connection::{Connection, rustls_connection};
1818
use crate::crypto_provider::{self, rustls_crypto_provider};
1919
use crate::error::{map_error, rustls_result};
2020
use crate::ffi::{
21-
arc_castable, box_castable, free_arc, free_box, set_arc_mut_ptr, set_boxed_mut_ptr,
22-
to_boxed_mut_ptr, try_box_from_ptr, try_clone_arc, try_mut_from_ptr, try_mut_from_ptr_ptr,
23-
try_ref_from_ptr, try_ref_from_ptr_ptr, try_slice, Castable, OwnershipRef,
21+
Castable, OwnershipRef, arc_castable, box_castable, free_arc, free_box, set_arc_mut_ptr,
22+
set_boxed_mut_ptr, to_boxed_mut_ptr, try_box_from_ptr, try_clone_arc, try_mut_from_ptr,
23+
try_mut_from_ptr_ptr, try_ref_from_ptr, try_ref_from_ptr_ptr, try_slice,
2424
};
25-
use crate::keylog::{rustls_keylog_log_callback, rustls_keylog_will_log_callback, CallbackKeyLog};
25+
use crate::keylog::{CallbackKeyLog, rustls_keylog_log_callback, rustls_keylog_will_log_callback};
2626
use crate::panic::ffi_panic_boundary;
2727
use crate::rslice::{rustls_slice_bytes, rustls_slice_slice_bytes, rustls_slice_u16, rustls_str};
2828
use crate::session::{
29-
rustls_session_store_get_callback, rustls_session_store_put_callback, SessionStoreBroker,
29+
SessionStoreBroker, rustls_session_store_get_callback, rustls_session_store_put_callback,
3030
};
3131
use crate::userdata::userdata_get;
3232
use crate::verifier::rustls_client_cert_verifier;

librustls/src/verifier.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ use std::slice;
22
use std::sync::Arc;
33

44
use libc::size_t;
5-
use rustls::client::danger::ServerCertVerifier;
65
use rustls::client::WebPkiServerVerifier;
6+
use rustls::client::danger::ServerCertVerifier;
77
use rustls::crypto::CryptoProvider;
8-
use rustls::pki_types::pem::PemObject;
98
use rustls::pki_types::CertificateRevocationListDer;
10-
use rustls::server::danger::ClientCertVerifier;
9+
use rustls::pki_types::pem::PemObject;
1110
use rustls::server::WebPkiClientVerifier;
11+
use rustls::server::danger::ClientCertVerifier;
1212
use rustls::{DistinguishedName, RootCertStore};
1313
use webpki::{ExpirationPolicy, RevocationCheckDepth, UnknownStatusPolicy};
1414

rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style_edition = "2024"

0 commit comments

Comments
 (0)