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 {
|
||||
match &s[..] {
|
||||
fn from(s: &'a str) -> FileIDType {
|
||||
match s {
|
||||
"UUID" => FileIDType::UUID,
|
||||
_ => 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)]
|
||||
pub struct FileID {
|
||||
id: Option<String>,
|
||||
|
|
Loading…
Reference in a new issue