Skip to content

Commit

Permalink
crate: fix other 2018 edition fudgeups
Browse files Browse the repository at this point in the history
  • Loading branch information
mcginty committed Apr 5, 2019
1 parent e5818f9 commit 64dbb97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ impl<'builder> Builder<'builder> {
/// Create a Builder with the ring resolver and default resolver as a fallback.
#[cfg(feature = "ring-accelerated")]
pub fn new(params: NoiseParams) -> Self {
use ::resolvers::{FallbackResolver, DefaultResolver, RingResolver};
use crate::resolvers::{FallbackResolver, DefaultResolver, RingResolver};

Self::with_resolver(params, Box::new(FallbackResolver::new(Box::new(RingResolver), Box::new(DefaultResolver))))
}

/// Create a Builder with the HACL* resolver and default resolver as a fallback.
#[cfg(feature = "hacl-star-accelerated")]
pub fn new(params: NoiseParams) -> Self {
use ::resolvers::{FallbackResolver, DefaultResolver, HaclStarResolver};
use crate::resolvers::{FallbackResolver, DefaultResolver, HaclStarResolver};

Self::with_resolver(params, Box::new(FallbackResolver::new(Box::new(HaclStarResolver), Box::new(DefaultResolver))))
}
Expand Down
16 changes: 7 additions & 9 deletions src/resolvers/hacl_star.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
extern crate hacl_star;

use std::mem;
use super::CryptoResolver;
use params::{DHChoice, HashChoice, CipherChoice};
use types::{Random, Dh, Hash, Cipher};
use self::hacl_star::curve25519::{self, SecretKey, PublicKey};
use self::hacl_star::sha2::{Sha256, Sha512};
use self::hacl_star::chacha20poly1305;
use crate::params::{DHChoice, HashChoice, CipherChoice};
use crate::types::{Random, Dh, Hash, Cipher};
use hacl_star::curve25519::{self, SecretKey, PublicKey};
use hacl_star::sha2::{Sha256, Sha512};
use hacl_star::chacha20poly1305;

use byteorder::{ByteOrder, LittleEndian};

Expand Down Expand Up @@ -216,10 +214,10 @@ mod tests {

extern crate hex;

use types::*;
use crate::types::*;
use super::*;
use self::hex::FromHex;
use super::hacl_star::poly1305::Poly1305;
use hacl_star::poly1305::Poly1305;

#[test]
fn test_sha256() {
Expand Down
12 changes: 5 additions & 7 deletions src/resolvers/ring.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
extern crate ring;

use super::CryptoResolver;
use byteorder::{ByteOrder, BigEndian, LittleEndian};
use self::ring::aead;
use self::ring::digest;
use constants::TAGLEN;
use params::{DHChoice, HashChoice, CipherChoice};
use types::{Random, Dh, Hash, Cipher};
use ring::aead;
use ring::digest;
use crate::constants::TAGLEN;
use crate::params::{DHChoice, HashChoice, CipherChoice};
use crate::types::{Random, Dh, Hash, Cipher};

/// A resolver that chooses [ring](https://github.com/briansmith/ring)-backed
/// primitives when available.
Expand Down

0 comments on commit 64dbb97

Please sign in to comment.