diff --git a/src/commands/add.rs b/src/commands/add.rs index 66021f5..ea690f8 100644 --- a/src/commands/add.rs +++ b/src/commands/add.rs @@ -1,16 +1,12 @@ use std::io::Write; -use std::fs::OpenOptions; use std::path::{Path, PathBuf}; use clap::Values; use glob::glob; -use crate::store::index; use crate::store::{self, object::Object}; use crate::utils::{self, path}; use crate::utils::nextsyncignore::{self, ignore_file}; use crate::utils::path::{normalize_relative, repo_root, path_buf_to_string}; -use super::status::get_all_objs; - pub struct AddArgs<'a> { pub files: Option>, pub force: bool, diff --git a/src/commands/config.rs b/src/commands/config.rs index cb958d1..a2a4c67 100644 --- a/src/commands/config.rs +++ b/src/commands/config.rs @@ -2,7 +2,6 @@ use std::fs::OpenOptions; use clap::Values; use std::io::{self, Write, BufRead, Seek, SeekFrom}; use crate::utils::{path, read}; -use tempfile::tempfile; use std::collections::HashMap; pub struct ConfigSetArgs<'a> { diff --git a/src/store/object.rs b/src/store/object.rs index 3229309..79a412a 100644 --- a/src/store/object.rs +++ b/src/store/object.rs @@ -131,7 +131,7 @@ fn rm(hash: &str) -> io::Result<()> { fn rm_node(path: &Path, node: &str) -> io::Result<()> { let mut root = path::objects(); - let (dir, rest) = hash_obj(path.clone().to_str().unwrap()); + let (dir, rest) = hash_obj(path.to_str().unwrap()); root.push(dir); root.push(rest); @@ -143,7 +143,7 @@ fn rm_node(path: &Path, node: &str) -> io::Result<()> { fn add_node(path: &Path, node: &str) -> io::Result<()> { let mut root = path::objects(); - let (dir, rest) = hash_obj(path.clone().to_str().unwrap()); + let (dir, rest) = hash_obj(path.to_str().unwrap()); root.push(dir); if !root.exists() { @@ -168,7 +168,7 @@ fn update_dates(mut path: PathBuf, date: &str) -> io::Result<()> { let (dir, res) = hash_obj(path.to_str().unwrap()); obj_p.push(dir); obj_p.push(res); - update_date(obj_p.clone(), date.clone())?; + update_date(obj_p.clone(), date)?; obj_p.pop(); obj_p.pop(); } diff --git a/src/subcommands/push.rs b/src/subcommands/push.rs index 82db1fe..3365d0c 100644 --- a/src/subcommands/push.rs +++ b/src/subcommands/push.rs @@ -1,4 +1,4 @@ -use clap::{App, Arg, SubCommand}; +use clap::{App, SubCommand}; pub fn create() -> App<'static, 'static> { SubCommand::with_name("push") diff --git a/src/subcommands/reset.rs b/src/subcommands/reset.rs index 348ca9d..90593ba 100644 --- a/src/subcommands/reset.rs +++ b/src/subcommands/reset.rs @@ -1,4 +1,4 @@ -use clap::{App, Arg, SubCommand}; +use clap::{App, SubCommand}; pub fn create() -> App<'static, 'static> { SubCommand::with_name("reset")