mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 13:26:28 +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
|
// the returned suffix is lower-case
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
pub fn dc_get_filesuffix_lc(path_filename: impl AsRef<str>) -> Option<String> {
|
pub fn dc_get_filesuffix_lc(path_filename: impl AsRef<str>) -> Option<String> {
|
||||||
if let Some(p) = Path::new(path_filename.as_ref()).extension() {
|
Path::new(path_filename.as_ref())
|
||||||
Some(p.to_string_lossy().to_lowercase())
|
.extension()
|
||||||
} else {
|
.map(|p| p.to_string_lossy().to_lowercase())
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the `(width, height)` of the given image buffer.
|
/// Returns the `(width, height)` of the given image buffer.
|
||||||
|
|||||||
Reference in New Issue
Block a user