diff options
author | rabite <rabite@posteo.de> | 2019-06-11 01:32:44 +0200 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-06-11 01:56:29 +0200 |
commit | e5c61ea63e4ed05480e4c00edf0bb6c710e366e4 (patch) | |
tree | 1765d951d1a73256a5185c333dcb929b2d16983d | |
parent | caf242986ceadc881b29fa9197a70128b6fb8f39 (diff) |
fixed crash on fbsd+zfs. have fun ;)v1.2.3
-rw-r--r-- | src/file_browser.rs | 2 | ||||
-rw-r--r-- | src/stats.rs | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/file_browser.rs b/src/file_browser.rs index b8d15dd..578a0bb 100644 --- a/src/file_browser.rs +++ b/src/file_browser.rs @@ -1184,7 +1184,7 @@ impl FileBrowser { let dev = fs.get_dev(); let free_space = fs.get_free(); let total_space = fs.get_total(); - let space = format!("{}: {} / {}", + let space = format!("{}{} / {}", dev, free_space, total_space); diff --git a/src/stats.rs b/src/stats.rs index c601a65..1d93e1b 100644 --- a/src/stats.rs +++ b/src/stats.rs @@ -66,10 +66,9 @@ pub trait FsExt { impl FsExt for Filesystem { fn get_dev(&self) -> String { let path = PathBuf::from(&self.fs_mounted_from); - let dev = path.components().last().unwrap(); - let dev = match dev { - Component::Normal(dev) => dev.to_string_lossy().to_string(), - _ => "wtf".to_string() + let dev = match path.components().last() { + Some(Component::Normal(dev)) => dev.to_string_lossy().to_string() + ": ", + _ => "".to_string() }; dev } |