Skip to content

Commit 51abfa1

Browse files
rubdoshdevalence
authored andcommitted
Move to Rust 2018 edition (#45)
* Move to Rust 2018 * Fix edition idioms.
1 parent bd40f61 commit 51abfa1

File tree

4 files changed

+8
-26
lines changed

4 files changed

+8
-26
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "merlin"
33
version = "1.2.0"
44
authors = ["Henry de Valence <[email protected]>",
55
"isis agora lovecruft <[email protected]>"]
6+
edition = "2018"
67
readme = "README.md"
78
license = "MIT"
89
repository = "https://github.com/dalek-cryptography/merlin"

src/lib.rs

+3-22
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,10 @@ please file an issue!
1515
"#
1616
);
1717

18-
extern crate byteorder;
19-
extern crate clear_on_drop;
20-
extern crate keccak;
21-
extern crate rand_core;
22-
23-
#[cfg(feature = "std")]
24-
extern crate core;
25-
26-
#[cfg(test)]
27-
extern crate curve25519_dalek;
28-
#[cfg(feature = "hex")]
29-
extern crate hex;
30-
#[cfg(test)]
31-
extern crate rand;
32-
#[cfg(test)]
33-
extern crate rand_chacha;
34-
#[cfg(test)]
35-
extern crate strobe_rs;
36-
3718
mod constants;
3819
mod strobe;
3920
mod transcript;
4021

41-
pub use transcript::Transcript;
42-
pub use transcript::TranscriptRng;
43-
pub use transcript::TranscriptRngBuilder;
22+
pub use crate::transcript::Transcript;
23+
pub use crate::transcript::TranscriptRng;
24+
pub use crate::transcript::TranscriptRngBuilder;

src/strobe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Strobe128 {
3636
}
3737

3838
impl ::core::fmt::Debug for Strobe128 {
39-
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
39+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4040
// Ensure that the Strobe state isn't accidentally logged
4141
write!(f, "Strobe128: STATE OMITTED")
4242
}

src/transcript.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rand_core;
22

3-
use strobe::Strobe128;
3+
use crate::strobe::Strobe128;
44

55
fn encode_u64(x: u64) -> [u8; 8] {
66
use byteorder::{ByteOrder, LittleEndian};
@@ -66,7 +66,7 @@ impl Transcript {
6666
/// Transcripts](https://merlin.cool/use/passing.html) section of
6767
/// the Merlin website for more details on why.
6868
pub fn new(label: &'static [u8]) -> Transcript {
69-
use constants::MERLIN_PROTOCOL_LABEL;
69+
use crate::constants::MERLIN_PROTOCOL_LABEL;
7070

7171
#[cfg(feature = "debug-transcript")]
7272
{
@@ -391,7 +391,7 @@ mod tests {
391391
impl TestTranscript {
392392
/// Strobe init; meta-AD(label)
393393
pub fn new(label: &[u8]) -> TestTranscript {
394-
use constants::MERLIN_PROTOCOL_LABEL;
394+
use crate::constants::MERLIN_PROTOCOL_LABEL;
395395

396396
let mut tt = TestTranscript {
397397
state: Strobe::new(MERLIN_PROTOCOL_LABEL.to_vec(), SecParam::B128),

0 commit comments

Comments
 (0)