simplify pickup_last_saved_time

pull/13898/head
Rene Leonhardt 2025-07-07 10:36:42 +02:00
parent 45fb545ce9
commit 4647374449
No known key found for this signature in database
GPG Key ID: 8C95C84F75AB1E8E
1 changed files with 4 additions and 13 deletions

View File

@ -1182,19 +1182,10 @@ impl Document {
pub fn pickup_last_saved_time(&mut self) {
self.last_saved_time = match self.path() {
Some(path) => match path.metadata() {
Ok(metadata) => match metadata.modified() {
Ok(mtime) => mtime,
Err(err) => {
log::debug!("Could not fetch file system's mtime, falling back to current system time: {}", err);
SystemTime::now()
}
},
Err(err) => {
log::debug!("Could not fetch file system's mtime, falling back to current system time: {}", err);
SystemTime::now()
}
},
Some(path) => path.metadata().and_then(|m| m.modified()).unwrap_or_else(|err| {
log::debug!("Could not fetch file system's mtime, falling back to current system time: {}", err);
SystemTime::now()
}),
None => SystemTime::now(),
};
}