diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-04-29 10:42:30 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-04-29 10:48:28 +0200 |
commit | 68df53a1467f0dd9c37114cdb7980783fb1fa3a0 (patch) | |
tree | 32213b67883891866a51c38f17e4ff46e26e2d9a /src/failable/ops/and.rs | |
parent | b531c50e550d05c95ea02370ba02c0535a4ef5f5 (diff) |
Make error type associated
The problem with the FailingFilter was, that the error type was not an
associated type but a generic type parameter.
This patch fixes this.
Diffstat (limited to 'src/failable/ops/and.rs')
-rw-r--r-- | src/failable/ops/and.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/failable/ops/and.rs b/src/failable/ops/and.rs index 1d195a6..4568b71 100644 --- a/src/failable/ops/and.rs +++ b/src/failable/ops/and.rs @@ -24,11 +24,13 @@ impl<T, U> FailableAnd<T, U> { } -impl<N, E, T, U> FailableFilter<N, E> for FailableAnd<T, U> - where T: FailableFilter<N, E>, - U: FailableFilter<N, E> +impl<N, T, U, E> FailableFilter<N> for FailableAnd<T, U> + where T: FailableFilter<N, Error = E>, + U: FailableFilter<N, Error = E> { - fn filter(&self, e: &N) -> Result<bool, E> { + type Error = E; + + fn filter(&self, e: &N) -> Result<bool, Self::Error> { Ok(try!(self.0.filter(e)) && try!(self.1.filter(e))) } } |