diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-04-09 03:04:54 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-04-09 03:20:43 -0400 |
commit | 4c12a9eed43b6c0a2c3b194a7201ba25e0b8432b (patch) | |
tree | 8c8c5c1f92b955e05171b66b3a8d125608feaabf /tests/util.rs | |
parent | f92b84f214923a180b455eb7f5dbb69f6973db87 (diff) | |
download | matasano-4c12a9eed43b6c0a2c3b194a7201ba25e0b8432b.tar.gz matasano-4c12a9eed43b6c0a2c3b194a7201ba25e0b8432b.zip |
stop using rustc_serialize
Diffstat (limited to 'tests/util.rs')
-rw-r--r-- | tests/util.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/util.rs b/tests/util.rs index a253c2d..0d1e37f 100644 --- a/tests/util.rs +++ b/tests/util.rs @@ -4,14 +4,11 @@ use rand::{Rng, RngCore}; use std::fs::File; use std::io::prelude::*; -use rustc_serialize::base64::FromBase64; -use rustc_serialize::hex::FromHex; - pub fn read_as_hex_lines(filename: &str) -> Vec<Vec<u8>> { let fh = File::open(filename).unwrap(); return std::io::BufReader::new(fh) .lines() - .map(|line| line.unwrap().from_hex().unwrap()) + .map(|line| hex::decode(line.unwrap()).unwrap()) .collect(); } @@ -19,7 +16,7 @@ pub fn read_as_base64_lines(filename: &str) -> Vec<Vec<u8>> { let fh = File::open(filename).unwrap(); return std::io::BufReader::new(fh) .lines() - .map(|line| line.unwrap().from_base64().unwrap()) + .map(|line| base64::decode(&line.unwrap()).unwrap()) .collect(); } @@ -35,7 +32,7 @@ pub fn read_as_base64(filename: &str) -> Vec<u8> { let fh = File::open(filename).unwrap(); return std::io::BufReader::new(fh) .lines() - .map(|line| line.unwrap().from_base64().unwrap()) + .map(|line| base64::decode(&line.unwrap()).unwrap()) .collect::<Vec<Vec<u8>>>() .concat(); } |