Skip to content

Commit 39735af

Browse files
committed
fix: simplify setup_ktls() sig
1 parent 01d94ed commit 39735af

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/linux/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ async fn read_record<S: AsyncRead, B: IoBufMut>(stream: &mut S, mut buf: B) -> i
2828
Ok(buf_try!(@try stream.read_exact(buf.slice(offset..offset + len)).await.into_inner()).1)
2929
}
3030

31-
fn setup_ktls<S, C, K, E>(socket: &S, secrets: K, session: &C) -> Result<(), ktls_core::Error>
31+
fn setup_ktls<S, C, K>(socket: &S, secrets: K, session: &C) -> Result<(), ktls_core::Error>
3232
where
3333
S: AsFd,
3434
C: TlsSession,
35-
ExtractedSecrets: TryFrom<K, Error = E>,
36-
ktls_core::Error: From<E>,
35+
K: TryInto<ExtractedSecrets, Error = ktls_core::Error>,
3736
{
3837
let ExtractedSecrets {
3938
tx: (seq_tx, secrets_tx),
4039
rx: (seq_rx, secrets_rx),
41-
} = ExtractedSecrets::try_from(secrets)?;
40+
} = secrets.try_into()?;
4241

4342
let protocol_version = session.protocol_version();
4443
let tls_crypto_info_tx = TlsCryptoInfoTx::new(protocol_version, secrets_tx, seq_tx)?;

0 commit comments

Comments
 (0)