Add Result::map_or_default and Option::map_or_default#141659
Merged
bors merged 1 commit intorust-lang:masterfrom May 28, 2025
Merged
Add Result::map_or_default and Option::map_or_default#141659bors merged 1 commit intorust-lang:masterfrom
Result::map_or_default and Option::map_or_default#141659bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
Contributor
Author
|
r? @Amanieu |
Amanieu
reviewed
May 27, 2025
| } | ||
|
|
||
| /// Maps a `Result<T, E>` to a `U` by applying function `f` to the contained | ||
| /// value if the result is [`Ok`], otherwise if [`Err`], returns the |
Member
There was a problem hiding this comment.
Suggested change
| /// value if the result is [`Ok`], otherwise if [`Err`], returns the | |
| /// value if the result is [`Ok`], otherwise if [`Err`] returns the |
Contributor
Author
There was a problem hiding this comment.
In the documentation of unwrap_or_default there is a comma:
Member
|
That's fair. Let's just keep the wording consistent for now. @bors r+ rollup |
Collaborator
Contributor
Author
bors
added a commit
that referenced
this pull request
May 28, 2025
Rollup of 8 pull requests Successful merges: - #140367 (add `asm_cfg`: `#[cfg(...)]` within `asm!`) - #140894 (Make check-cfg diagnostics work in `#[doc(cfg(..))]`) - #141252 (gvn: bail out unavoidable non-ssa locals in repeat) - #141517 (rustdoc: use descriptive tooltip if doctest is conditionally ignored) - #141551 (Make two transmute-related MIR lints into HIR lint) - #141591 (ci: fix llvm test coverage) - #141647 (Bump master `stage0` compiler) - #141659 (Add `Result::map_or_default` and `Option::map_or_default`) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
May 28, 2025
Rollup merge of #141659 - tkr-sh:map-or-default, r=Amanieu Add `Result::map_or_default` and `Option::map_or_default` Closes: #138068 _This PR has been recreated because of the inactivity of the author (Cf. #138068 (comment)
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
May 28, 2025
Rollup of 8 pull requests Successful merges: - rust-lang/rust#140367 (add `asm_cfg`: `#[cfg(...)]` within `asm!`) - rust-lang/rust#140894 (Make check-cfg diagnostics work in `#[doc(cfg(..))]`) - rust-lang/rust#141252 (gvn: bail out unavoidable non-ssa locals in repeat) - rust-lang/rust#141517 (rustdoc: use descriptive tooltip if doctest is conditionally ignored) - rust-lang/rust#141551 (Make two transmute-related MIR lints into HIR lint) - rust-lang/rust#141591 (ci: fix llvm test coverage) - rust-lang/rust#141647 (Bump master `stage0` compiler) - rust-lang/rust#141659 (Add `Result::map_or_default` and `Option::map_or_default`) r? `@ghost` `@rustbot` modify labels: rollup
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
May 30, 2025
Add `Result::map_or_default` and `Option::map_or_default` Closes: rust-lang#138068 _This PR has been recreated because of the inactivity of the author (Cf. rust-lang#138068 (comment)
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
May 30, 2025
Rollup of 8 pull requests Successful merges: - rust-lang#140367 (add `asm_cfg`: `#[cfg(...)]` within `asm!`) - rust-lang#140894 (Make check-cfg diagnostics work in `#[doc(cfg(..))]`) - rust-lang#141252 (gvn: bail out unavoidable non-ssa locals in repeat) - rust-lang#141517 (rustdoc: use descriptive tooltip if doctest is conditionally ignored) - rust-lang#141551 (Make two transmute-related MIR lints into HIR lint) - rust-lang#141591 (ci: fix llvm test coverage) - rust-lang#141647 (Bump master `stage0` compiler) - rust-lang#141659 (Add `Result::map_or_default` and `Option::map_or_default`) r? `@ghost` `@rustbot` modify labels: rollup
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #138068
This PR has been recreated because of the inactivity of the author (Cf. #138068 (comment))