1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

refactor: address clippy warnings

This commit is contained in:
Rob Ede
2024-05-06 06:03:44 +01:00
parent bb65628de5
commit c1a6388614
6 changed files with 8 additions and 11 deletions

View File

@ -154,15 +154,11 @@ impl<T: ResourcePath> Path<T> {
None
}
/// Get matched parameter by name.
/// Returns matched parameter by name.
///
/// If keyed parameter is not available empty string is used as default value.
pub fn query(&self, key: &str) -> &str {
if let Some(s) = self.get(key) {
s
} else {
""
}
self.get(key).unwrap_or_default()
}
/// Return iterator to items in parameter container.