Skip to content
Myr

Remove &E argument from with_context signature

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 895d383 · Browse files · 1 file+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:src/context.rs+5 added-5 removed
13 unmodified lines
14 /// Wrap the error value with additional context lazily.15 fn with_context<C, F>(self, f: F) -> Result<T, Error>16 where17 C: Display + Send + Sync + 'static,18 F: FnOnce(&E) -> C;18 F: FnOnce() -> C;19}2021impl<T, E> Context<T, E> for Result<T, E>22where
8 unmodified lines
3132 fn with_context<C, F>(self, f: F) -> Result<T, Error>33 where34 C: Display + Send + Sync + 'static,35 F: FnOnce(&E) -> C,35 F: FnOnce() -> C,36 {37 self.map_err(|error| {38 Error::from(ContextError {39 context: f(&error),39 context: f(),40 error,41 })42 })43 }
9 unmodified lines
5354 fn with_context<C, F>(self, f: F) -> Result<T, Error>55 where56 C: Display + Send + Sync + 'static,57 F: FnOnce(&Error) -> C,57 F: FnOnce() -> C,58 {59 self.map_err(|error| {60 Error::from(ContextError {61 context: f(&error),61 context: f(),62 error,63 })64 })65 }
60 unmodified lines