diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/listing.rs | 7 | ||||
-rw-r--r-- | src/webdav_fs.rs | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/listing.rs b/src/listing.rs index bd82c94..d908e23 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -274,10 +274,7 @@ pub fn directory_listing( if conf.no_symlinks && is_symlink { continue; } - let last_modification_date = match metadata.modified() { - Ok(date) => Some(date), - Err(_) => None, - }; + let last_modification_date = metadata.modified().ok(); if metadata.is_dir() { entries.push(Entry::new( @@ -298,7 +295,7 @@ pub fn directory_listing( symlink_dest, )); if conf.readme && readme_rx.is_match(&file_name.to_lowercase()) { - let ext = file_name.split('.').last().unwrap().to_lowercase(); + let ext = file_name.split('.').next_back().unwrap().to_lowercase(); readme = Some(( file_name.to_string(), if ext == "md" { diff --git a/src/webdav_fs.rs b/src/webdav_fs.rs index 63c9f94..cf434ba 100644 --- a/src/webdav_fs.rs +++ b/src/webdav_fs.rs @@ -25,7 +25,7 @@ impl RestrictedFs { /// true if any normal component of path either starts with dot or can't be turned into a str fn path_has_hidden_components(path: &DavPath) -> bool { path.as_pathbuf().components().any(|c| match c { - Component::Normal(name) => name.to_str().map_or(true, |s| s.starts_with('.')), + Component::Normal(name) => name.to_str().is_none_or(|s| s.starts_with('.')), _ => false, }) } |