diff --git a/src/storage/file_id.rs b/src/storage/file_id.rs index f05eaa4e..c582aa8e 100644 --- a/src/storage/file_id.rs +++ b/src/storage/file_id.rs @@ -127,7 +127,7 @@ impl From for FileID { impl<'a> From<&'a String> for FileID { fn from(string: &'a String) -> FileID { - + // we assume that it is an path let regex = Regex::new(r"([:alnum:]*)-([:upper:]*)-([A-Za-z0-9-_]*)\.(.*)").unwrap(); let s = string.split("/").last().unwrap_or(""); @@ -160,9 +160,10 @@ impl<'a> From<&'a String> for FileID { Some(FileID::new(idtype, String::from(hash))) }).unwrap_or({ debug!("Did not match"); + debug!("It is no path, actually. So we assume it is an ID already"); FileID { id_type: FileIDType::NONE, - id: None, + id: Some(string.clone()), } }) }