diff --git a/src/storage/file_id.rs b/src/storage/file_id.rs index 6bbc4ea1..645669b7 100644 --- a/src/storage/file_id.rs +++ b/src/storage/file_id.rs @@ -31,10 +31,10 @@ impl Into for FileIDType { } -impl From for FileIDType { +impl<'a> From<&'a str> for FileIDType { - fn from(s: String) -> FileIDType { - match &s[..] { + fn from(s: &'a str) -> FileIDType { + match s { "UUID" => FileIDType::UUID, _ => FileIDType::NONE, } @@ -42,6 +42,14 @@ impl From for FileIDType { } +impl From for FileIDType { + + fn from(s: String) -> FileIDType { + FileIDType::from(&s[..]) + } + +} + #[derive(Clone)] pub struct FileID { id: Option,