Skip to content

Commit 29943a3

Browse files
authored
Merge pull request #145 from GnomedDev/fix-clippy
Fix clippy warnings
2 parents 6772c60 + e939a74 commit 29943a3

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

src/asynch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ where
253253
self.split_with(ManagedSplitState::new())
254254
}
255255

256+
#[allow(clippy::type_complexity)] // Requires inherent type aliases to solve well.
256257
pub fn split_with<StateContainer>(
257258
self,
258259
state: StateContainer,

src/blocking.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ where
6969
///
7070
/// Returns an error if the handshake does not proceed. If an error occurs, the connection
7171
/// instance must be recreated.
72-
pub fn open<'v, Provider>(
73-
&mut self,
74-
mut context: TlsContext<'v, Provider>,
75-
) -> Result<(), TlsError>
72+
pub fn open<Provider>(&mut self, mut context: TlsContext<Provider>) -> Result<(), TlsError>
7673
where
7774
Provider: CryptoProvider<CipherSuite = CipherSuite>,
7875
{
@@ -244,6 +241,7 @@ where
244241
self.split_with(ManagedSplitState::new())
245242
}
246243

244+
#[allow(clippy::type_complexity)] // Requires inherent type aliases to solve well.
247245
pub fn split_with<StateContainer>(
248246
self,
249247
state: StateContainer,

src/connection.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ where
137137
certificate_request: Option<CertificateRequest>,
138138
}
139139

140-
impl<'v, CipherSuite> Handshake<CipherSuite>
140+
impl<CipherSuite> Handshake<CipherSuite>
141141
where
142142
CipherSuite: TlsCipherSuite,
143143
{
@@ -437,10 +437,10 @@ where
437437
}
438438
}
439439

440-
fn process_server_verify<'a, 'v, Provider>(
440+
fn process_server_verify<Provider>(
441441
handshake: &mut Handshake<Provider::CipherSuite>,
442442
key_schedule: &mut KeySchedule<Provider::CipherSuite>,
443-
config: &TlsConfig<'a>,
443+
config: &TlsConfig<'_>,
444444
crypto_provider: &mut Provider,
445445
record: ServerRecord<'_, Provider::CipherSuite>,
446446
) -> Result<State, TlsError>

src/handshake/certificate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ impl<'a> CertificateEntryRef<'a> {
100100
}
101101

102102
pub(crate) fn encode(&self, buf: &mut CryptoBuffer<'_>) -> Result<(), TlsError> {
103-
match self {
104-
&CertificateEntryRef::RawPublicKey(_key) => {
103+
match *self {
104+
CertificateEntryRef::RawPublicKey(_key) => {
105105
todo!("ASN1_subjectPublicKeyInfo encoding?");
106106
// buf.with_u24_length(|buf| buf.extend_from_slice(key))?;
107107
}
108-
&CertificateEntryRef::X509(cert) => {
108+
CertificateEntryRef::X509(cert) => {
109109
buf.with_u24_length(|buf| buf.extend_from_slice(cert))?;
110110
}
111111
}

src/record_reader.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ impl<'a> RecordReader<'a> {
7272
self.consume(header, key_schedule.transcript_hash())
7373
}
7474

75-
fn advance_blocking<'m>(
76-
&'m mut self,
75+
fn advance_blocking(
76+
&mut self,
7777
transport: &mut impl BlockingRead,
7878
amount: usize,
7979
) -> Result<(), TlsError> {

tests/psk_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn setup() -> (SocketAddr, JoinHandle<()>) {
5454
let mut conn = acceptor.accept(stream).unwrap();
5555
let mut buf = [0; 64];
5656
let len = conn.read(&mut buf[..]).unwrap();
57-
conn.write(&buf[..len]).unwrap();
57+
conn.write_all(&buf[..len]).unwrap();
5858
});
5959
(addr, h)
6060
}

tests/tlsserver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl Connection {
240240
// If we have a successful but empty read, that's an EOF.
241241
// Otherwise, we shove the data into the TLS session.
242242
match maybe_len {
243-
Some(len) if len == 0 => {
243+
Some(0) => {
244244
log::debug!("back eof");
245245
self.closing = true;
246246
}

0 commit comments

Comments
 (0)