fix: resolve unused variables and mutable issues
This commit is contained in:
29
src/main.rs
29
src/main.rs
@@ -519,10 +519,10 @@ fn mode_diff(cmd: &mut Command, args: Args, ids: &mut Vec<i64>, tags: &mut Vec<S
|
||||
|
||||
let compression_engine_b = compression::get_engine(compression_type_b).expect("Unable to get compression engine");
|
||||
|
||||
let (fd_a_read, fd_a_write) = unistd::pipe().unwrap();
|
||||
let (fd_b_read, fd_b_write) = unistd::pipe().unwrap();
|
||||
let (_fd_a_read, fd_a_write) = unistd::pipe().unwrap();
|
||||
let (_fd_b_read, fd_b_write) = unistd::pipe().unwrap();
|
||||
|
||||
let mut child = std::process::Command::new("diff")
|
||||
let child = std::process::Command::new("diff")
|
||||
.arg("-u")
|
||||
.stdin(std::process::Stdio::piped())
|
||||
.stdout(std::process::Stdio::piped())
|
||||
@@ -532,32 +532,13 @@ fn mode_diff(cmd: &mut Command, args: Args, ids: &mut Vec<i64>, tags: &mut Vec<S
|
||||
|
||||
let stdout_a = unsafe { std::fs::File::from_raw_fd(fd_a_write) };
|
||||
let stdout_b = unsafe { std::fs::File::from_raw_fd(fd_b_write) };
|
||||
let mut stdout_a = BufWriter::new(stdout_a);
|
||||
let mut stdout_b = BufWriter::new(stdout_b);
|
||||
let mut stdout_a = BufWriter::new(stdout_a);
|
||||
let mut stdout_b = BufWriter::new(stdout_b);
|
||||
let stdout_a = BufWriter::new(stdout_a);
|
||||
let stdout_b = BufWriter::new(stdout_b);
|
||||
|
||||
let mut child_stdin = child.stdin.unwrap();
|
||||
compression_engine_a.copy(item_path_a.clone(), &mut stdout_a)?;
|
||||
compression_engine_b.copy(item_path_b.clone(), &mut stdout_b)?;
|
||||
|
||||
let output = child.wait_with_output().expect("Failed to wait on diff command");
|
||||
if output.status.success() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stdout));
|
||||
} else {
|
||||
eprintln!("{}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
if output.status.success() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stdout));
|
||||
} else {
|
||||
eprintln!("{}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
if output.status.success() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stdout));
|
||||
} else {
|
||||
eprintln!("{}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
|
||||
if output.status.success() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stdout));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user