mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Simplify dc_get_filesuffix_lc
This commit is contained in:
committed by
holger krekel
parent
36014f9fe5
commit
2304d63bb3
@@ -278,11 +278,9 @@ pub fn dc_derive_safe_stem_ext(filename: &str) -> (String, String) {
|
||||
// the returned suffix is lower-case
|
||||
#[allow(non_snake_case)]
|
||||
pub fn dc_get_filesuffix_lc(path_filename: impl AsRef<str>) -> Option<String> {
|
||||
if let Some(p) = Path::new(path_filename.as_ref()).extension() {
|
||||
Some(p.to_string_lossy().to_lowercase())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
Path::new(path_filename.as_ref())
|
||||
.extension()
|
||||
.map(|p| p.to_string_lossy().to_lowercase())
|
||||
}
|
||||
|
||||
/// Returns the `(width, height)` of the given image buffer.
|
||||
|
||||
Reference in New Issue
Block a user