mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-07 04:59:49 +00:00
utils: use itertools
utils
This commit is contained in:
@@ -35,7 +35,7 @@ pub fn sanitize(name: &str) -> String {
|
||||
.to_string()
|
||||
})
|
||||
.filter(|label| !label.is_empty())
|
||||
.collect::<Vec<_>>()
|
||||
.collect_vec()
|
||||
.join(".");
|
||||
name.truncate(253);
|
||||
if dot {
|
||||
|
||||
@@ -49,7 +49,7 @@ where
|
||||
type Error = <Model as TryFrom<&'m Message>>::Error;
|
||||
|
||||
fn try_from(value: &'m Vec<Message>) -> Result<Self, Self::Error> {
|
||||
Ok(Self(value.into_iter().map_try_into().try_collect()?))
|
||||
Ok(Self(value.iter().map_try_into().try_collect()?))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user