Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turn unwrap_or into unwrap_or_else and vice versa #13120

Merged
merged 5 commits into from Aug 31, 2022

Conversation

Austaras
Copy link
Contributor

closes #12983

@Austaras Austaras force-pushed the master branch 5 times, most recently from d88dbe3 to f6c724f Compare August 26, 2022 10:24
@A-Walrus
Copy link

This looks really good, thanks for working on it! :)
A few nits:

  • Results don't have the ok_or / ok_or_else methods.
  • It would be nice to add methods for these (on both options and results)
    • or(5) <-> or_else(|| 5)
    • map_or(5,foo) <-> map_or_else(|| 5, foo)

@Austaras Austaras force-pushed the master branch 2 times, most recently from 41cafb6 to db63562 Compare August 27, 2022 13:03
@jonas-schievink
Copy link
Contributor

Thanks, this looks pretty good!

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 31, 2022

📌 Commit 43e8d96 has been approved by jonas-schievink

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 31, 2022

⌛ Testing commit 43e8d96 with merge 7f38581...

@bors
Copy link
Collaborator

bors commented Aug 31, 2022

☀️ Test successful - checks-actions
Approved by: jonas-schievink
Pushing 7f38581 to master...

@bors bors merged commit 7f38581 into rust-lang:master Aug 31, 2022
@lnicola
Copy link
Member

lnicola commented Aug 31, 2022

changelog feature (first contribution) add assist to change between XXX_or and XXX_or_else

@lnicola
Copy link
Member

lnicola commented Sep 5, 2022

unwrap-or-to-unwrap-or-else.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code action to transform between foo_or and foo_or_else
7 participants