mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-28 11:38:01 +00:00
Stabilize `result_option_inspect`
This PR stabilizes `result_option_inspect`:
```rust
// core::option
impl Option<T> {
pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self;
}
// 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;
}
```
<br>
Tracking issue: https://github.com/rust-lang/rust/issues/91345.
Implementation PR: https://github.com/rust-lang/rust/pull/91346.
Closes https://github.com/rust-lang/rust/issues/91345.