some clippy fixes

This commit is contained in:
euzu
2025-07-24 14:27:57 +02:00
parent 213496cf90
commit 78e138e5d8
50 changed files with 2324 additions and 793 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ pub fn get_non_empty_str<'a>(first: &'a str, second: &'a str, third: &'a str) ->
}
}
pub fn trim_slash(s: &str) -> Cow<str> {
pub fn trim_slash(s: &str) -> Cow<'_, str> {
let trimmed = s.trim_matches('/');
if trimmed.len() == s.len() {
Cow::Borrowed(s) // Keine Änderung → kein Clone
@@ -74,7 +74,7 @@ pub fn trim_slash(s: &str) -> Cow<str> {
}
}
pub fn trim_last_slash(s: &str) -> Cow<str> {
pub fn trim_last_slash(s: &str) -> Cow<'_, str> {
if s.ends_with('/') {
if let Some(stripped) = s.strip_suffix('/') {
return Cow::Owned(stripped.to_string())