mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 01:03:54 +00:00
disallow some methods from itertools
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
use crate::utils::MapTryInto;
|
||||
use derivative::Derivative;
|
||||
use derive_more::{Deref, DerefMut, From, IntoIterator};
|
||||
use itertools::Itertools;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub trait MessageModel<Message: prost::Message>:
|
||||
@@ -49,7 +47,12 @@ where
|
||||
type Error = <Model as TryFrom<&'m Message>>::Error;
|
||||
|
||||
fn try_from(value: &'m Vec<Message>) -> Result<Self, Self::Error> {
|
||||
Ok(Self(value.iter().map_try_into().try_collect()?))
|
||||
Ok(Self(
|
||||
value
|
||||
.iter()
|
||||
.map(TryInto::try_into)
|
||||
.collect::<Result<_, _>>()?,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +62,6 @@ where
|
||||
Model: MessageModel<Message>,
|
||||
{
|
||||
fn from(value: RepeatedMessageModel<Model>) -> Self {
|
||||
value.into_iter().map_into().collect()
|
||||
value.into_iter().map(Into::into).collect()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user