fix: minor warnings

This commit is contained in:
lol 2024-02-20 21:28:18 +01:00
parent cc916c0ed6
commit 1217fe0480
5 changed files with 5 additions and 10 deletions

View File

@ -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<Values<'a>>,
pub force: bool,

View File

@ -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> {

View File

@ -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();
}

View File

@ -1,4 +1,4 @@
use clap::{App, Arg, SubCommand};
use clap::{App, SubCommand};
pub fn create() -> App<'static, 'static> {
SubCommand::with_name("push")

View File

@ -1,4 +1,4 @@
use clap::{App, Arg, SubCommand};
use clap::{App, SubCommand};
pub fn create() -> App<'static, 'static> {
SubCommand::with_name("reset")