Use FileIDType::from() and remove select_id_type_from_str()
This commit is contained in:
parent
ce4d99384b
commit
1b0f4894ac
1 changed files with 1 additions and 8 deletions
|
@ -151,7 +151,7 @@ impl<'a> From<&'a String> for FileID {
|
||||||
debug!(" Hash Name: {:?}", hashname);
|
debug!(" Hash Name: {:?}", hashname);
|
||||||
debug!(" Hash: {:?}", hash);
|
debug!(" Hash: {:?}", hash);
|
||||||
|
|
||||||
let idtype = select_id_type_from_str(hashname);
|
let idtype = FileIDType::from(hashname);
|
||||||
match idtype {
|
match idtype {
|
||||||
FileIDType::NONE => hash = "INVALID",
|
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>;
|
pub type FileIDResult = Result<FileID, FileIDError>;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Reference in a new issue