(self, f: F)
| 141 | |
| 142 | #[inline] |
| 143 | fn with_context<C, F>(self, f: F) -> Result<T> |
| 144 | where |
| 145 | C: fmt::Display + Send + Sync + 'static, |
| 146 | F: FnOnce() -> C, |
| 147 | { |
| 148 | match self { |
| 149 | Ok(x) => Ok(x), |
| 150 | Err(e) => Err(Error::new(e).context(f())), |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | impl<T> Context<T, Error> for Result<T> { |