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 cf058d5 commit fadee9dCopy full SHA for fadee9d
plugins/fs-extra/src/lib.rs
@@ -78,9 +78,10 @@ struct Metadata {
78
}
79
80
fn system_time_to_ms(time: std::io::Result<SystemTime>) -> u64 {
81
- time.map(|t| {
82
- let duration_since_epoch = t.duration_since(UNIX_EPOCH).unwrap();
83
- duration_since_epoch.as_millis() as u64
+ time.map(|time| {
+ time.duration_since(UNIX_EPOCH)
+ .map(|t| t.as_millis() as u64)
84
+ .unwrap_or_else(|err| err.duration().as_millis() as u64)
85
})
86
.unwrap_or_default()
87
0 commit comments