From 445f543159c89d0a4e444461002eef2325e324d4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 3 Dec 2015 17:33:16 +0100 Subject: [PATCH] Impl From for FileIDType --- src/storage/file_id.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/storage/file_id.rs b/src/storage/file_id.rs index 5d3ebb7e..014ad3e6 100644 --- a/src/storage/file_id.rs +++ b/src/storage/file_id.rs @@ -31,6 +31,17 @@ impl Into for FileIDType { } +impl From for FileIDType { + + fn from(s: String) -> FileIDType { + match &s[..] { + "UUID" => FileIDType::UUID, + _ => FileIDType::NONE, + } + } + +} + #[derive(Clone)] pub struct FileID { id: Option,