Closed
Description
Feature gate: #![feature(result_option_inspect)]
This is a tracking issue for Option::inspect
and Result::{inspect, inspect_err}
.
Public API
// core::result
impl Result<T, E> {
pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self;
pub fn inspect_err<F: FnOnce(&E)>(self, f: F) -> Self;
}
// core::option
impl Option<T> {
pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self;
}
Steps / History
- Implementation: Add
Option::inspect
andResult::{inspect, inspect_err}
#91346 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- Should there be a more general
Tap
trait instd
?