Fix clippy warnings

This commit is contained in:
Eduard Tolosa 2023-06-12 15:49:46 -05:00
parent e68c28b223
commit f69fee8287
2 changed files with 5 additions and 5 deletions

View file

@ -18,7 +18,7 @@ pub fn commit_to_database(connection: &Connection, args: &Args) -> Result<()> {
"INSERT INTO snapshots (name, snap_id, kind, source, destination, ro_rw) VALUES ('{}', '{}', '{}', '{}', '{}', '{}')", "INSERT INTO snapshots (name, snap_id, kind, source, destination, ro_rw) VALUES ('{}', '{}', '{}', '{}', '{}', '{}')",
args.snapshot_name, args.snapshot_id, args.snapshot_kind, args.source_dir, args.dest_dir, args.snapshot_ro_rw args.snapshot_name, args.snapshot_id, args.snapshot_kind, args.source_dir, args.dest_dir, args.snapshot_ro_rw
); );
connection.execute(&statement)?; connection.execute(statement)?;
Ok(()) Ok(())
} }
@ -28,7 +28,7 @@ pub fn delete_from_database(connection: &Connection, args: &Args) -> Result<()>
"DELETE FROM snapshots WHERE name = '{}' OR snap_id = '{}'", "DELETE FROM snapshots WHERE name = '{}' OR snap_id = '{}'",
args.snapshot_id, args.snapshot_id args.snapshot_id, args.snapshot_id
); );
connection.execute(&statement)?; connection.execute(statement)?;
Ok(()) Ok(())
} }

View file

@ -18,7 +18,7 @@ pub fn take_snapshot(args: &Args) -> bool {
pub fn del_snapshot(args: &Args) -> bool { pub fn del_snapshot(args: &Args) -> bool {
Command::new("btrfs") Command::new("btrfs")
.args(&["subvolume", "delete", &args.snapshot_name]) .args(["subvolume", "delete", &args.snapshot_name])
.status() .status()
.expect("Error deleting the snapshot.") .expect("Error deleting the snapshot.")
.success() .success()
@ -27,12 +27,12 @@ pub fn del_snapshot(args: &Args) -> bool {
pub fn restore_snapshot(args: &Args) -> bool { pub fn restore_snapshot(args: &Args) -> bool {
(!Path::new(&args.source_dir).exists() (!Path::new(&args.source_dir).exists()
|| Command::new("btrfs") || Command::new("btrfs")
.args(&["subvolume", "delete", &args.source_dir]) .args(["subvolume", "delete", &args.source_dir])
.status() .status()
.expect("Error deleting the subvolume.") .expect("Error deleting the subvolume.")
.success()) .success())
&& Command::new("btrfs") && Command::new("btrfs")
.args(&[ .args([
"subvolume", "subvolume",
"snapshot", "snapshot",
&args.snapshot_name, &args.snapshot_name,