about summary refs log tree commit diff stats
path: root/src/select/selection_file/duration.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/selection_file/duration.rs')
-rw-r--r--src/select/selection_file/duration.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/select/selection_file/duration.rs b/src/select/selection_file/duration.rs
index 4224ead..f7a39cb 100644
--- a/src/select/selection_file/duration.rs
+++ b/src/select/selection_file/duration.rs
@@ -28,6 +28,10 @@ impl FromStr for Duration {
                 .context("Failed to parse hours")
         }
 
+        if s == "[No Duration]" {
+            return Ok(Self { time: 0 });
+        }
+
         let buf: Vec<_> = s.split(' ').collect();
 
         let hours;
@@ -45,7 +49,10 @@ impl FromStr for Duration {
             minutes = parse_num(buf[0], 'm')?;
             seconds = parse_num(buf[1], 's')?;
         } else {
-            unreachable!("The first part always ends with 'h' or 'm'")
+            unreachable!(
+                "The first part always ends with 'h' or 'm', but was: {:#?}",
+                buf
+            )
         }
 
         Ok(Self {