Skip to content

Commit

Permalink
Use DeserializeOwned in AuthKeyExchange trait as opposed to HRTB.
Browse files Browse the repository at this point in the history
This is cleaner syntax and also gets around a compiler bug outlined here:
rust-lang/rust#57639
  • Loading branch information
rozbb committed Jan 15, 2019
1 parent c0924ce commit 5bb89cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use rand::{ Rng, CryptoRng };
use serde::{ Serialize, Deserialize };
use serde::{ Serialize, de::DeserializeOwned };
use crate::Envelope;


pub trait AuthKeyExchange {
type PrivateKey: Serialize + for<'a> Deserialize<'a>;
type PublicKey: Serialize + for<'a> Deserialize<'a> + Clone;
type EphemeralKey: Serialize + for<'a> Deserialize<'a>;
type Message: Serialize + for<'a> Deserialize<'a> + Clone;
type PrivateKey: Serialize + DeserializeOwned;
type PublicKey: Serialize + DeserializeOwned + Clone;
type EphemeralKey: Serialize + DeserializeOwned;
type Message: Serialize + DeserializeOwned + Clone;

const SHARED_LENGTH: usize;

Expand Down

0 comments on commit 5bb89cd

Please sign in to comment.