Fix Display impl for StoreId by using lossy string rep if PathBuf::to_str() fails

This commit is contained in:
Matthias Beyer 2016-07-05 13:47:58 +02:00
parent 1211a99775
commit 580ea28877

View file

@ -46,7 +46,7 @@ impl Display for StoreId {
fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FmtError> { fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FmtError> {
match self.0.to_str() { match self.0.to_str() {
Some(s) => write!(fmt, "{}", s), Some(s) => write!(fmt, "{}", s),
None => write!(fmt, "<non-UTF8-StoreId>"), // TODO: Sure here? None => write!(fmt, "{}", self.0.to_string_lossy()),
} }
} }