diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-04-29 10:51:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-29 10:51:45 +0200 |
commit | a174b5c3b09cd232347dcdb5448324c225c0433d (patch) | |
tree | 32213b67883891866a51c38f17e4ff46e26e2d9a /src/failable/ops/not.rs | |
parent | b531c50e550d05c95ea02370ba02c0535a4ef5f5 (diff) | |
parent | 68df53a1467f0dd9c37114cdb7980783fb1fa3a0 (diff) |
Merge pull request #28 from matthiasbeyer/failable-filters-output-error
Make error type associated
Diffstat (limited to 'src/failable/ops/not.rs')
-rw-r--r-- | src/failable/ops/not.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/failable/ops/not.rs b/src/failable/ops/not.rs index 25c3e3b..bc55230 100644 --- a/src/failable/ops/not.rs +++ b/src/failable/ops/not.rs @@ -24,10 +24,12 @@ impl<T> FailableNot<T> { } -impl<N, E, T> FailableFilter<N, E> for FailableNot<T> - where T: FailableFilter<N, E> +impl<N, T> FailableFilter<N> for FailableNot<T> + where T: FailableFilter<N> { - fn filter(&self, e: &N) -> Result<bool, E> { + type Error = T::Error; + + fn filter(&self, e: &N) -> Result<bool, Self::Error> { self.0.filter(e).map(|b| !b) } } |