Tracking Issue for result_option_inspect
· Issue #91345 · rust-lang/rust
Navigation Menu
- [GitHub Copilot
Write better code with AI](https://github.com/features/copilot)
- [GitHub Copilot
[GitHub Advanced Security
Find and fix vulnerabilities](https://github.com/security/advanced-security)[Actions
Automate any workflow](https://github.com/features/actions)[Codespaces
Instant dev environments](https://github.com/features/codespaces)[Issues
Plan and track work](https://github.com/features/issues)[Code Review
Manage code changes](https://github.com/features/code-review)[Discussions
Collaborate outside of code](https://github.com/features/discussions)[Code Search
Find more, search less](https://github.com/features/code-search)Explore
- [GitHub Sponsors
Fund open source developers](https://github.com/sponsors)
- [GitHub Sponsors
[The ReadME Project
GitHub community articles](https://github.com/readme)- [Enterprise platform
AI-powered developer platform](https://github.com/enterprise)
- [Enterprise platform
Use saved searches to filter your results more quickly
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
?