mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
streamline mimetype guessing and build_body_file
This commit is contained in:
@@ -548,11 +548,11 @@ fn validate_filename(filename: &str) -> String {
|
||||
|
||||
// the returned suffix is lower-case
|
||||
#[allow(non_snake_case)]
|
||||
pub unsafe fn dc_get_filesuffix_lc(path_filename: impl AsRef<str>) -> *mut libc::c_char {
|
||||
pub fn dc_get_filesuffix_lc(path_filename: impl AsRef<str>) -> Option<String> {
|
||||
if let Some(p) = Path::new(path_filename.as_ref()).extension() {
|
||||
p.to_string_lossy().to_lowercase().strdup()
|
||||
Some(p.to_string_lossy().to_lowercase())
|
||||
} else {
|
||||
ptr::null_mut()
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user