Use FileIDType::from() and remove select_id_type_from_str()

This commit is contained in:
Matthias Beyer 2015-12-03 17:37:13 +01:00
parent ce4d99384b
commit 1b0f4894ac

View file

@ -151,7 +151,7 @@ impl<'a> From<&'a String> for FileID {
debug!(" Hash Name: {:?}", hashname);
debug!(" Hash: {:?}", hash);
let idtype = select_id_type_from_str(hashname);
let idtype = FileIDType::from(hashname);
match idtype {
FileIDType::NONE => hash = "INVALID",
_ => {},
@ -231,13 +231,6 @@ impl<'a> Display for FileIDError {
}
fn select_id_type_from_str(s: &str) -> FileIDType {
match s {
"UUID" => FileIDType::UUID,
_ => FileIDType::NONE,
}
}
pub type FileIDResult = Result<FileID, FileIDError>;
#[cfg(test)]