Remove Clone
bound for Element::map
This commit is contained in:
parent
4758e2ff75
commit
b5cd9923f2
@ -171,7 +171,7 @@ where
|
||||
/// ```
|
||||
pub fn map<F, B>(self, f: F) -> Element<'a, B, Renderer>
|
||||
where
|
||||
Message: 'static + Clone,
|
||||
Message: 'static,
|
||||
Renderer: 'a,
|
||||
B: 'static,
|
||||
F: 'static + Fn(Message) -> B,
|
||||
@ -269,7 +269,6 @@ impl<'a, A, B, Renderer> Map<'a, A, B, Renderer> {
|
||||
|
||||
impl<'a, A, B, Renderer> Widget<B, Renderer> for Map<'a, A, B, Renderer>
|
||||
where
|
||||
A: Clone,
|
||||
Renderer: crate::Renderer,
|
||||
{
|
||||
fn width(&self) -> Length {
|
||||
@ -309,8 +308,7 @@ where
|
||||
);
|
||||
|
||||
original_messages
|
||||
.iter()
|
||||
.cloned()
|
||||
.drain(..)
|
||||
.for_each(|message| messages.push((self.mapper)(message)));
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,8 @@ impl<'a, Message> Element<'a, Message> {
|
||||
/// [`Element`]: struct.Element.html
|
||||
pub fn map<F, B>(self, f: F) -> Element<'a, B>
|
||||
where
|
||||
Message: 'static + Clone,
|
||||
B: 'static + Clone,
|
||||
Message: 'static,
|
||||
B: 'static,
|
||||
F: 'static + Fn(Message) -> B,
|
||||
{
|
||||
Element {
|
||||
@ -82,8 +82,8 @@ impl<'a, A, B> Map<'a, A, B> {
|
||||
|
||||
impl<'a, A, B> Widget<B> for Map<'a, A, B>
|
||||
where
|
||||
A: 'static + Clone,
|
||||
B: 'static + Clone,
|
||||
A: 'static,
|
||||
B: 'static,
|
||||
{
|
||||
fn node<'b>(
|
||||
&self,
|
||||
|
Loading…
Reference in New Issue
Block a user