improve error management and interaction with object

This commit is contained in:
grimhilt
2023-06-07 17:23:27 +02:00
parent c5abc57e9a
commit 3f441dd22b
3 changed files with 57 additions and 19 deletions

View File

@@ -1,4 +1,3 @@
use crate::utils;
use std::fs::File;
use crypto::digest::Digest;
use crypto::sha1::Sha1;
@@ -6,6 +5,7 @@ use std::collections::HashMap;
use colored::Colorize;
use std::path::PathBuf;
use std::io;
use crate::utils::{self, object};
#[derive(PartialEq)]
enum RemoveSide {
@@ -36,7 +36,7 @@ pub fn status() {
if let Ok(ip) = line {
dbg!(ip.clone().len());
if ip.clone().len() > 5 {
let (hash, name) = ip.split_once(" ").unwrap();
let (ftype, hash, name) = object::parse_line(ip);
hashes.insert(String::from(hash), String::from(name));
}
}