auto clippy fixes

This commit is contained in:
Folkert 2023-06-26 20:42:50 +02:00
parent 72c85efc83
commit ef39bad7c6
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
146 changed files with 750 additions and 1005 deletions

View file

@ -42,7 +42,7 @@ pub fn map_get<'a, K: ::std::fmt::Debug + std::hash::Hash + std::cmp::Eq, V>(
key: &K,
) -> UtilResult<&'a V> {
let value = hash_map.get(key).context(KeyNotFoundSnafu {
key_str: format!("{:?}", key),
key_str: format!("{key:?}"),
})?;
Ok(value)
@ -53,8 +53,8 @@ pub fn index_of<T: ::std::fmt::Debug + std::cmp::Eq>(elt: T, slice: &[T]) -> Uti
.iter()
.position(|slice_elt| *slice_elt == elt)
.with_context(|| {
let elt_str = format!("{:?}", elt);
let collection_str = format!("{:?}", slice);
let elt_str = format!("{elt:?}");
let collection_str = format!("{slice:?}");
IndexOfFailedSnafu {
elt_str,
@ -115,8 +115,8 @@ pub fn first_last_index_of<T: ::std::fmt::Debug + std::cmp::Eq>(
if let (Some(first_index), Some(last_index)) = (first_index_opt, last_index_opt) {
Ok((first_index, last_index))
} else {
let elt_str = format!("{:?}", elt);
let collection_str = format!("{:?}", slice);
let elt_str = format!("{elt:?}");
let collection_str = format!("{slice:?}");
IndexOfFailedSnafu {
elt_str,