From 915cbd24ef8c7868b41927a64476d13bac4a6f52 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 3 Dec 2015 17:53:24 +0100 Subject: [PATCH] Impl From for FileID, using From for FileID --- src/storage/file_id.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/file_id.rs b/src/storage/file_id.rs index afc28c0c..f05eaa4e 100644 --- a/src/storage/file_id.rs +++ b/src/storage/file_id.rs @@ -179,8 +179,9 @@ impl From for FileID { impl<'a> From<&'a PathBuf> for FileID { - fn from(s: &'a PathBuf) -> FileID { - unimplemented!() + fn from(pb: &'a PathBuf) -> FileID { + let s = pb.to_str().unwrap_or(""); + FileID::from(String::from(s)) } }