-
Notifications
You must be signed in to change notification settings - Fork 2.6k
add into function for PrefixIterator #10614
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of calling normal functions same as common traits. If this has to be done as a free functions, rather call it into_other
or something else.
Also,
Can't this be done with actual From
or Into
? e.g. Impl<T, OR1, OR2> From<PrefixIterator<T, OR1>> for From<PrefixIterator<T, OR2>
@kianenigma , Unfortunately it is not possible to implement So ok, will rename it to |
frame/support/src/storage/mod.rs
Outdated
@@ -802,6 +802,18 @@ pub struct PrefixIterator<T, OnRemoval = ()> { | |||
phantom: core::marker::PhantomData<OnRemoval>, | |||
} | |||
|
|||
impl<T, OnRemoval1> PrefixIterator<T, OnRemoval1> { | |||
pub fn into_other<OnRemoval2>(self) -> PrefixIterator<T, OnRemoval2> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub
item needs documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I would call this convert_on_removal
. into_other
isn't really expressing.
* add into function for PrefixIterator * update with comments * update with comments
* add into function for PrefixIterator * update with comments * update with comments
Small refactor, add
into
function which conveertsPrefixIterator<T, O1>
into anotherPrefixIterator<T, O2>