Remove the remaining AsRef<str> (#3669)

Using &str instead of AsRef is better for compile times, binary size and code complexity.
This commit is contained in:
iequidoo
2022-11-28 14:00:34 -03:00
committed by iequidoo
parent e5be023e4b
commit f6a502a8e3
16 changed files with 153 additions and 167 deletions

View File

@@ -206,7 +206,7 @@ async fn maybe_warn_on_bad_time(context: &Context, now: i64, known_past_timestam
msg.text = Some(
stock_str::bad_time_msg_body(
context,
Local
&Local
.timestamp(now, 0)
.format("%Y-%m-%d %H:%M:%S")
.to_string(),
@@ -319,8 +319,8 @@ pub(crate) fn extract_grpid_from_rfc724_mid(mid: &str) -> Option<&str> {
}
// the returned suffix is lower-case
pub fn get_filesuffix_lc(path_filename: impl AsRef<str>) -> Option<String> {
Path::new(path_filename.as_ref())
pub fn get_filesuffix_lc(path_filename: &str) -> Option<String> {
Path::new(path_filename)
.extension()
.map(|p| p.to_string_lossy().to_lowercase())
}