We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 365c12f commit 7379810Copy full SHA for 7379810
src/server/routes/ui/experiments.rs
@@ -127,7 +127,13 @@ struct ExperimentContext {
127
}
128
129
fn humanize(duration: Duration) -> String {
130
- let duration = duration.to_std().expect("non-negative duration");
+ let duration = match duration.to_std() {
131
+ Ok(d) => d,
132
+ Err(_) => {
133
+ // Don't try to make it pretty as a fallback.
134
+ return format!("{:?}", duration);
135
+ }
136
+ };
137
if duration.as_secs() < 60 {
138
format!("{duration:?}")
139
} else if duration.as_secs() < 60 * 60 {
0 commit comments