propagate error instead of unwrapping

This commit is contained in:
Adithya Nair 2023-03-22 01:25:17 +05:30
parent e033a2fcaf
commit 6a342a49a9
No known key found for this signature in database
GPG Key ID: 0C7F35F4F821290F
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ impl fmt::Display for Generation {
}
fn read_build_time(path: &Path) -> Result<Date> {
let build_time = time::OffsetDateTime::from(fs::metadata(path)?.created().unwrap()).date();
let build_time = time::OffsetDateTime::from(fs::metadata(path)?.created()?).date();
Ok(build_time)
}