diff --git a/src/cell.rs b/src/cell.rs index f79c62c..4288c12 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -170,7 +170,7 @@ impl Cell { } } - pub fn listen_weak(&self, k: K) -> Listener { + pub fn listen_weak(&self, k: K) -> Listener { Listener { impl_: self.impl_.listen_weak(k), } diff --git a/src/impl_/cell.rs b/src/impl_/cell.rs index db82941..f20e28c 100644 --- a/src/impl_/cell.rs +++ b/src/impl_/cell.rs @@ -235,7 +235,7 @@ impl Cell { pub fn map + Send + Sync + 'static>( &self, - mut f: FN, + f: FN, ) -> Cell where A: Clone, @@ -314,7 +314,7 @@ impl Cell { &self, cb: &Cell, cc: &Cell, - mut f: FN, + f: FN, ) -> Cell where A: Clone, @@ -340,7 +340,7 @@ impl Cell { cb: &Cell, cc: &Cell, cd: &Cell, - mut f: FN, + f: FN, ) -> Cell where A: Clone, @@ -371,7 +371,7 @@ impl Cell { cc: &Cell, cd: &Cell, ce: &Cell, - mut f: FN, + f: FN, ) -> Cell where A: Clone, @@ -405,7 +405,7 @@ impl Cell { cd: &Cell, ce: &Cell, cf: &Cell, - mut f: FN, + f: FN, ) -> Cell where A: Clone, @@ -598,7 +598,7 @@ impl Cell { .hold_lazy(Lazy::new(move || cca2.sample().sample())) } - pub fn listen_weak(&self, k: K) -> Listener + pub fn listen_weak(&self, k: K) -> Listener where A: Clone, { diff --git a/src/impl_/lambda.rs b/src/impl_/lambda.rs index 0cbc233..26fc852 100644 --- a/src/impl_/lambda.rs +++ b/src/impl_/lambda.rs @@ -42,32 +42,32 @@ pub fn lambda6_deps>(f: } pub trait IsLambda1 { - fn call(&mut self, a: &A) -> B; + fn call(&self, a: &A) -> B; fn deps_op(&self) -> Option<&Vec>; } pub trait IsLambda2 { - fn call(&mut self, a: &A, b: &B) -> C; + fn call(&self, a: &A, b: &B) -> C; fn deps_op(&self) -> Option<&Vec>; } pub trait IsLambda3 { - fn call(&mut self, a: &A, b: &B, c: &C) -> D; + fn call(&self, a: &A, b: &B, c: &C) -> D; fn deps_op(&self) -> Option<&Vec>; } pub trait IsLambda4 { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D) -> E; + fn call(&self, a: &A, b: &B, c: &C, d: &D) -> E; fn deps_op(&self) -> Option<&Vec>; } pub trait IsLambda5 { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D, e: &E) -> F; + fn call(&self, a: &A, b: &B, c: &C, d: &D, e: &E) -> F; fn deps_op(&self) -> Option<&Vec>; } pub trait IsLambda6 { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D, e: &E, f: &F) -> G; + fn call(&self, a: &A, b: &B, c: &C, d: &D, e: &E, f: &F) -> G; fn deps_op(&self) -> Option<&Vec>; } @@ -81,8 +81,8 @@ impl B> IsLambda1 for Lambda { } } -impl B> IsLambda1 for FN { - fn call(&mut self, a: &A) -> B { +impl B> IsLambda1 for FN { + fn call(&self, a: &A) -> B { self(a) } @@ -91,8 +91,8 @@ impl B> IsLambda1 for FN { } } -impl C> IsLambda2 for Lambda { - fn call(&mut self, a: &A, b: &B) -> C { +impl C> IsLambda2 for Lambda { + fn call(&self, a: &A, b: &B) -> C { (self.f)(a, b) } @@ -101,8 +101,8 @@ impl C> IsLambda2 for Lambda { } } -impl C> IsLambda2 for FN { - fn call(&mut self, a: &A, b: &B) -> C { +impl C> IsLambda2 for FN { + fn call(&self, a: &A, b: &B) -> C { self(a, b) } @@ -111,8 +111,8 @@ impl C> IsLambda2 for FN { } } -impl D> IsLambda3 for Lambda { - fn call(&mut self, a: &A, b: &B, c: &C) -> D { +impl D> IsLambda3 for Lambda { + fn call(&self, a: &A, b: &B, c: &C) -> D { (self.f)(a, b, c) } @@ -121,8 +121,8 @@ impl D> IsLambda3 for Lambda D> IsLambda3 for FN { - fn call(&mut self, a: &A, b: &B, c: &C) -> D { +impl D> IsLambda3 for FN { + fn call(&self, a: &A, b: &B, c: &C) -> D { self(a, b, c) } @@ -131,8 +131,8 @@ impl D> IsLambda3 for FN { } } -impl E> IsLambda4 for Lambda { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D) -> E { +impl E> IsLambda4 for Lambda { + fn call(&self, a: &A, b: &B, c: &C, d: &D) -> E { (self.f)(a, b, c, d) } @@ -141,8 +141,8 @@ impl E> IsLambda4 for } } -impl E> IsLambda4 for FN { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D) -> E { +impl E> IsLambda4 for FN { + fn call(&self, a: &A, b: &B, c: &C, d: &D) -> E { self(a, b, c, d) } @@ -151,10 +151,8 @@ impl E> IsLambda4 for } } -impl F> IsLambda5 - for Lambda -{ - fn call(&mut self, a: &A, b: &B, c: &C, d: &D, e: &E) -> F { +impl F> IsLambda5 for Lambda { + fn call(&self, a: &A, b: &B, c: &C, d: &D, e: &E) -> F { (self.f)(a, b, c, d, e) } @@ -163,8 +161,8 @@ impl F> IsLambda5 F> IsLambda5 for FN { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D, e: &E) -> F { +impl F> IsLambda5 for FN { + fn call(&self, a: &A, b: &B, c: &C, d: &D, e: &E) -> F { self(a, b, c, d, e) } @@ -173,10 +171,10 @@ impl F> IsLambda5 G> IsLambda6 +impl G> IsLambda6 for Lambda { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D, e: &E, f: &F) -> G { + fn call(&self, a: &A, b: &B, c: &C, d: &D, e: &E, f: &F) -> G { (self.f)(a, b, c, d, e, f) } @@ -185,10 +183,10 @@ impl G> IsLambda6 G> IsLambda6 +impl G> IsLambda6 for FN { - fn call(&mut self, a: &A, b: &B, c: &C, d: &D, e: &E, f: &F) -> G { + fn call(&self, a: &A, b: &B, c: &C, d: &D, e: &E, f: &F) -> G { self(a, b, c, d, e, f) } @@ -197,30 +195,30 @@ impl G> IsLambda6 B>(f: FN, deps: Vec) -> Lambda { +pub fn lambda1 B>(f: FN, deps: Vec) -> Lambda { Lambda { f, deps } } -pub fn lambda2 C>(f: FN, deps: Vec) -> Lambda { +pub fn lambda2 C>(f: FN, deps: Vec) -> Lambda { Lambda { f, deps } } -pub fn lambda3 D>(f: FN, deps: Vec) -> Lambda { +pub fn lambda3 D>(f: FN, deps: Vec) -> Lambda { Lambda { f, deps } } -pub fn lambda4 E>(f: FN, deps: Vec) -> Lambda { +pub fn lambda4 E>(f: FN, deps: Vec) -> Lambda { Lambda { f, deps } } -pub fn lambda5 F>( +pub fn lambda5 F>( f: FN, deps: Vec, ) -> Lambda { Lambda { f, deps } } -pub fn lambda6 G>( +pub fn lambda6 G>( f: FN, deps: Vec, ) -> Lambda { diff --git a/src/impl_/stream.rs b/src/impl_/stream.rs index b4ae9eb..f8aa248 100644 --- a/src/impl_/stream.rs +++ b/src/impl_/stream.rs @@ -205,7 +205,7 @@ impl Stream { >( &self, cb: &Cell, - mut f: FN, + f: FN, ) -> Stream { let cb = cb.clone(); let mut f_deps = lambda2_deps(&f); @@ -219,7 +219,7 @@ impl Stream { pub fn map + Send + Sync + 'static>( &self, - mut f: FN, + f: FN, ) -> Stream { let self_ = self.clone(); let sodium_ctx = self.sodium_ctx().clone(); @@ -243,10 +243,7 @@ impl Stream { }) } - pub fn filter + Send + Sync + 'static>( - &self, - mut pred: PRED, - ) -> Stream + pub fn filter + Send + Sync + 'static>(&self, pred: PRED) -> Stream where A: Clone, { @@ -283,7 +280,7 @@ impl Stream { pub fn merge + Send + Sync + 'static>( &self, s2: &Stream, - mut f: FN, + f: FN, ) -> Stream where A: Clone, @@ -434,7 +431,7 @@ impl Stream { pub fn _listen + Send + Sync + 'static>( &self, - mut k: K, + k: K, weak: bool, ) -> Listener { let self_ = self.clone(); diff --git a/src/stream.rs b/src/stream.rs index 1b95e1e..6272e7a 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -67,7 +67,7 @@ impl Stream { &self, cb: &Cell, cc: &Cell, - mut f: FN, + f: FN, ) -> Stream { let deps: Vec; if let Some(deps2) = f.deps_op() {