cleaning warnings

This commit is contained in:
grimhilt
2023-08-27 22:57:05 +02:00
parent 863e3bd68a
commit a35c7b20d8
13 changed files with 16 additions and 50 deletions

View File

@@ -223,32 +223,3 @@ fn create_obj(name: String, content: &str) -> io::Result<()> {
Ok(())
}
// get the last time a blob synced with remote
pub fn get_timestamp(path_s: String) -> Option<i64> {
let mut obj_p = path::objects();
let (dir, res) = hash_obj(&path_s);
obj_p.push(dir);
obj_p.push(res);
match read::read_lines(obj_p) {
Ok(mut reader) => {
match reader.next() {
Some(Ok(line)) => {
let mut data = line.rsplit(' ');
if data.clone().count() >= 2 {
Some(data.nth_back(1).unwrap().parse::<i64>().unwrap())
} else {
None
}
},
_ => None,
}
},
Err(err) => {
eprintln!("error reading object: {}", err);
None
},
}
}