Finishes the sink and returns a [`Result`] with a default success value. Similar to [`finish`], but uses `T::default()` as the success value. # Examples ``` # use error_stack::ReportSink; # use std::io; let mut sink = ReportSink::new(); # // needed for type inference # sink.capture(io::Error::new(io::ErrorKind::Other, "I/O error")); // ... add errors ... let result: Result , _> = sin
(mut self)
| 324 | /// |
| 325 | /// [`finish`]: ReportSink::finish |
| 326 | pub fn finish_default<T: Default>(mut self) -> Result<T, Report<[C]>> { |
| 327 | self.bomb.defuse(); |
| 328 | self.report.map_or_else(|| Ok(T::default()), Err) |
| 329 | } |
| 330 | |
| 331 | /// Finishes the sink and returns a [`Result`] with a provided success value. |
| 332 | /// |