diff options
-rw-r--r-- | src/stats.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/stats.rs b/src/stats.rs index c601a65..b908ed3 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(), + _ => "FS".to_string() }; dev } |