Skip to content

Commit 5bb89cd

Browse files
committed
Use DeserializeOwned in AuthKeyExchange trait as opposed to HRTB.
This is cleaner syntax and also gets around a compiler bug outlined here: rust-lang/rust#57639
1 parent c0924ce commit 5bb89cd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/traits.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use rand::{ Rng, CryptoRng };
2-
use serde::{ Serialize, Deserialize };
2+
use serde::{ Serialize, de::DeserializeOwned };
33
use crate::Envelope;
44

55

66
pub trait AuthKeyExchange {
7-
type PrivateKey: Serialize + for<'a> Deserialize<'a>;
8-
type PublicKey: Serialize + for<'a> Deserialize<'a> + Clone;
9-
type EphemeralKey: Serialize + for<'a> Deserialize<'a>;
10-
type Message: Serialize + for<'a> Deserialize<'a> + Clone;
7+
type PrivateKey: Serialize + DeserializeOwned;
8+
type PublicKey: Serialize + DeserializeOwned + Clone;
9+
type EphemeralKey: Serialize + DeserializeOwned;
10+
type Message: Serialize + DeserializeOwned + Clone;
1111

1212
const SHARED_LENGTH: usize;
1313

0 commit comments

Comments
 (0)