Impl From<PathBuf> for FileID, using From<String> for FileID

This commit is contained in:
Matthias Beyer 2015-12-03 17:53:24 +01:00
parent db9c4e48ba
commit 915cbd24ef

View file

@ -179,8 +179,9 @@ impl From<PathBuf> for FileID {
impl<'a> From<&'a PathBuf> for FileID { impl<'a> From<&'a PathBuf> for FileID {
fn from(s: &'a PathBuf) -> FileID { fn from(pb: &'a PathBuf) -> FileID {
unimplemented!() let s = pb.to_str().unwrap_or("");
FileID::from(String::from(s))
} }
} }