Impl From<&str> for FileIDType, use implementation in From<String> for FileIDType
This commit is contained in:
parent
f25e3683a1
commit
ce4d99384b
1 changed files with 11 additions and 3 deletions
|
@ -31,10 +31,10 @@ impl Into<String> for FileIDType {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<String> for FileIDType {
|
impl<'a> From<&'a str> for FileIDType {
|
||||||
|
|
||||||
fn from(s: String) -> FileIDType {
|
fn from(s: &'a str) -> FileIDType {
|
||||||
match &s[..] {
|
match s {
|
||||||
"UUID" => FileIDType::UUID,
|
"UUID" => FileIDType::UUID,
|
||||||
_ => FileIDType::NONE,
|
_ => FileIDType::NONE,
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,14 @@ impl From<String> for FileIDType {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<String> for FileIDType {
|
||||||
|
|
||||||
|
fn from(s: String) -> FileIDType {
|
||||||
|
FileIDType::from(&s[..])
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct FileID {
|
pub struct FileID {
|
||||||
id: Option<String>,
|
id: Option<String>,
|
||||||
|
|
Loading…
Reference in a new issue