Skip to content

Commit

Permalink
Apply all other clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a committed Dec 1, 2024
1 parent f2542af commit eb39d4d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 21 deletions.
9 changes: 4 additions & 5 deletions backhand-test/tests/add.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod common;

use std::process::Command;

use assert_cmd::prelude::*;
use tempfile::tempdir;
Expand Down Expand Up @@ -127,11 +126,11 @@ dr----x--t 2/4242 42 1970-01-01 00:01 squashfs-root/test
fn test_dont_emit_compression_options() {
use std::fs::File;
use std::io::Write;
use std::os::unix::prelude::PermissionsExt;


use backhand::DEFAULT_BLOCK_SIZE;
use nix::sys::stat::utimes;
use nix::sys::time::TimeVal;




const FILE_NAME: &str = "out.squashfs";
let asset_defs = [TestAssetDef {
Expand Down
4 changes: 0 additions & 4 deletions backhand-test/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use std::error::Error;
use std::process::Command;
use std::time::Duration;

use assert_cmd::prelude::*;
use backon::BlockingRetryable;
use backon::ExponentialBuilder;
use tempfile::tempdir;
use tempfile::tempdir_in;
use test_assets_ureq::TestAssetDef;

Expand Down
1 change: 0 additions & 1 deletion backhand-test/tests/mutate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::fs::File;
use std::io::{BufReader, BufWriter, Cursor};

use backhand::{FilesystemReader, FilesystemWriter, NodeHeader};
use common::{test_bin_unsquashfs, test_squashfs_tools_unsquashfs};
use test_assets_ureq::TestAssetDef;
use test_log::test;

Expand Down
10 changes: 5 additions & 5 deletions backhand-test/tests/non_standard.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod common;
use std::fs::File;
use std::io::{BufReader, BufWriter, Write};
use std::io::{BufReader, BufWriter};

use backhand::compression::{CompressionAction, Compressor, DefaultCompressor};
use backhand::kind::{self, Kind};
Expand All @@ -24,7 +24,7 @@ fn full_test(
kind: &Kind,
pad: Option<u32>,
) {
common::download_backoff(&assets_defs, test_path);
common::download_backoff(assets_defs, test_path);
let og_path = format!("{test_path}/{filepath}");
let new_path = format!("{test_path}/bytes.squashfs");
{
Expand All @@ -33,7 +33,7 @@ fn full_test(
let og_filesystem = FilesystemReader::from_reader_with_offset_and_kind(
file,
offset,
Kind::from_kind(&kind),
Kind::from_kind(kind),
)
.unwrap();
let mut new_filesystem = FilesystemWriter::from_fs_reader(&og_filesystem).unwrap();
Expand All @@ -57,7 +57,7 @@ fn full_test(
let _new_filesystem = FilesystemReader::from_reader_with_offset_and_kind(
created_file,
offset,
Kind::from_kind(&kind),
Kind::from_kind(kind),
)
.unwrap();
}
Expand Down Expand Up @@ -140,7 +140,7 @@ fn test_custom_compressor() {
if let Compressor::Gzip = compressor {
out.resize(out.capacity(), 0);
let mut decompressor = libdeflater::Decompressor::new();
let amt = decompressor.zlib_decompress(&bytes, out).unwrap();
let amt = decompressor.zlib_decompress(bytes, out).unwrap();
out.truncate(amt);
} else {
unimplemented!();
Expand Down
3 changes: 1 addition & 2 deletions backhand-test/tests/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ use backhand::{
kind, CompressionExtra, ExtraXz, FilesystemCompressor, FilesystemWriter, NodeHeader,
SuperBlock, DEFAULT_BLOCK_SIZE,
};
use common::{test_bin_unsquashfs, test_squashfs_tools_unsquashfs};
use test_assets_ureq::TestAssetDef;

#[test]
#[cfg(all(feature = "xz", feature = "gzip"))]
fn test_raw_00() {
use std::{io::BufReader, process::Command};
use std::io::BufReader;

use backhand::{kind::Kind, FilesystemReader};

Expand Down
1 change: 0 additions & 1 deletion backhand-test/tests/replace.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod common;

use std::process::Command;

use assert_cmd::prelude::*;
use tempfile::tempdir;
Expand Down
4 changes: 1 addition & 3 deletions backhand-test/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use std::fs::File;
use std::io::{BufReader, BufWriter};

use assert_cmd::prelude::*;
use assert_cmd::Command;
use backhand::{FilesystemReader, FilesystemWriter};
use common::{test_bin_unsquashfs, test_squashfs_tools_unsquashfs};
use tempfile::tempdir;
use common::test_bin_unsquashfs;
use test_assets_ureq::TestAssetDef;
use test_log::test;
use tracing::info;
Expand Down

0 comments on commit eb39d4d

Please sign in to comment.