From f69fee8287ed8fa63c7e2479acca667eaf0acb5e Mon Sep 17 00:00:00 2001 From: Eduard Tolosa Date: Mon, 12 Jun 2023 15:49:46 -0500 Subject: [PATCH] Fix clippy warnings --- src/database.rs | 4 ++-- src/operations.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/database.rs b/src/database.rs index e7a8398..c614be8 100644 --- a/src/database.rs +++ b/src/database.rs @@ -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 ('{}', '{}', '{}', '{}', '{}', '{}')", 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(()) } @@ -28,7 +28,7 @@ pub fn delete_from_database(connection: &Connection, args: &Args) -> Result<()> "DELETE FROM snapshots WHERE name = '{}' OR snap_id = '{}'", args.snapshot_id, args.snapshot_id ); - connection.execute(&statement)?; + connection.execute(statement)?; Ok(()) } diff --git a/src/operations.rs b/src/operations.rs index d37c913..b9457cc 100644 --- a/src/operations.rs +++ b/src/operations.rs @@ -18,7 +18,7 @@ pub fn take_snapshot(args: &Args) -> bool { pub fn del_snapshot(args: &Args) -> bool { Command::new("btrfs") - .args(&["subvolume", "delete", &args.snapshot_name]) + .args(["subvolume", "delete", &args.snapshot_name]) .status() .expect("Error deleting the snapshot.") .success() @@ -27,12 +27,12 @@ pub fn del_snapshot(args: &Args) -> bool { pub fn restore_snapshot(args: &Args) -> bool { (!Path::new(&args.source_dir).exists() || Command::new("btrfs") - .args(&["subvolume", "delete", &args.source_dir]) + .args(["subvolume", "delete", &args.source_dir]) .status() .expect("Error deleting the subvolume.") .success()) && Command::new("btrfs") - .args(&[ + .args([ "subvolume", "snapshot", &args.snapshot_name,