fix clippy warning and shorten links in tests

This commit is contained in:
Lireer 2022-01-26 14:53:19 +01:00
parent 85bb91fb50
commit 2e06844429
2 changed files with 5 additions and 5 deletions

View file

@ -167,7 +167,7 @@ impl<R: Read> Read for AesReaderValid<R> {
// this. // this.
let hmac = std::mem::replace( let hmac = std::mem::replace(
&mut self.hmac, &mut self.hmac,
Hmac::new(&GenericArray::from_slice( Hmac::new(GenericArray::from_slice(
&vec![0; <Hmac<Sha1> as KeySizeUser>::KeySize::to_usize()], &vec![0; <Hmac<Sha1> as KeySizeUser>::KeySize::to_usize()],
)), )),
); );

View file

@ -8,7 +8,7 @@ const PASSWORD: &[u8] = b"helloworld";
#[test] #[test]
fn aes256_encrypted_uncompressed_file() { fn aes256_encrypted_uncompressed_file() {
let mut v = Vec::new(); let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/aes_archive.zip")); v.extend_from_slice(include_bytes!("data/aes_archive.zip"));
let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file"); let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file");
let mut file = archive let mut file = archive
@ -26,7 +26,7 @@ fn aes256_encrypted_uncompressed_file() {
#[test] #[test]
fn aes256_encrypted_file() { fn aes256_encrypted_file() {
let mut v = Vec::new(); let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/aes_archive.zip")); v.extend_from_slice(include_bytes!("data/aes_archive.zip"));
let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file"); let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file");
let mut file = archive let mut file = archive
@ -44,7 +44,7 @@ fn aes256_encrypted_file() {
#[test] #[test]
fn aes192_encrypted_file() { fn aes192_encrypted_file() {
let mut v = Vec::new(); let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/aes_archive.zip")); v.extend_from_slice(include_bytes!("data/aes_archive.zip"));
let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file"); let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file");
let mut file = archive let mut file = archive
@ -62,7 +62,7 @@ fn aes192_encrypted_file() {
#[test] #[test]
fn aes128_encrypted_file() { fn aes128_encrypted_file() {
let mut v = Vec::new(); let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/aes_archive.zip")); v.extend_from_slice(include_bytes!("data/aes_archive.zip"));
let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file"); let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file");
let mut file = archive let mut file = archive