diff --git a/futures/src/subscription.rs b/futures/src/subscription.rs index 2afaaae9..e229b6df 100644 --- a/futures/src/subscription.rs +++ b/futures/src/subscription.rs @@ -244,7 +244,7 @@ impl Subscription { /// Adds a value to the [`Subscription`] context. /// /// The value will be part of the identity of a [`Subscription`]. - pub fn with(mut self, value: A) -> Subscription<(A, T)> + pub fn with(self, value: A) -> Subscription<(A, T)> where T: 'static, A: std::hash::Hash + Clone + Send + Sync + 'static, @@ -252,7 +252,7 @@ impl Subscription { Subscription { recipes: self .recipes - .drain(..) + .into_iter() .map(|recipe| { Box::new(With::new(recipe, value.clone())) as Box> @@ -266,7 +266,7 @@ impl Subscription { /// # Panics /// The closure provided must be a non-capturing closure. The method /// will panic in debug mode otherwise. - pub fn map(mut self, f: F) -> Subscription + pub fn map(self, f: F) -> Subscription where T: 'static, F: Fn(T) -> A + MaybeSend + Clone + 'static, @@ -281,7 +281,7 @@ impl Subscription { Subscription { recipes: self .recipes - .drain(..) + .into_iter() .map(move |recipe| { Box::new(Map::new(recipe, f.clone())) as Box>