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

Change is_some_and to take by value #98354

Merged
merged 2 commits into from
Oct 2, 2022

Conversation

camsteffen
Copy link
Contributor

Consistent with other function-accepting Option methods.

Tracking issue: #93050

r? @m-ou-se

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 21, 2022
@rust-highfive
Copy link
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 21, 2022
@Xiretza
Copy link
Contributor

Xiretza commented Jun 21, 2022

Option::is_some and Option::is_none take &self. I'd say this function is more similar to those than, say, unwrap_or_else(), which actually gives you the value contained in the option.

@m-ou-se
Copy link
Member

m-ou-se commented Jun 21, 2022

This seems like a discusssion to have on the tracking issue and get consensus on first.

(I personally think it'd be confusing if an is_ method would consume the Option, and we should be consistent with is_some.)

@m-ou-se m-ou-se closed this Jun 21, 2022
@camsteffen
Copy link
Contributor Author

camsteffen commented Jul 28, 2022

Reopening per #99087 (comment). I need to change is_ok_and,is_err_and too.

@rustbot
Copy link
Collaborator

rustbot commented Jul 28, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@camsteffen
Copy link
Contributor Author

Also changed the feature name. Not sure if that is wanted.

@bors
Copy link
Contributor

bors commented Aug 22, 2022

☔ The latest upstream changes (presumably #99702) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@m-ou-se m-ou-se left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! r=me after rebasing.

@m-ou-se m-ou-se added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 27, 2022
@camsteffen
Copy link
Contributor Author

@bors r=m-ou-se

@bors
Copy link
Contributor

bors commented Sep 28, 2022

📌 Commit d88463b363684fdff191a19355ebe108e20500f4 has been approved by m-ou-se

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 28, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 28, 2022

The Miri subtree was changed

cc @rust-lang/miri

@camsteffen
Copy link
Contributor Author

@bors r=m-ou-se

@bors
Copy link
Contributor

bors commented Sep 28, 2022

📌 Commit 596176dd74dce4c5d43155c09fcfa81be118dce8 has been approved by m-ou-se

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 29, 2022

⌛ Testing commit 596176dd74dce4c5d43155c09fcfa81be118dce8 with merge 9feea309bae62e17e247b52e80b3c32f90c19891...

@bors
Copy link
Contributor

bors commented Sep 29, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 29, 2022
@camsteffen
Copy link
Contributor Author

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 29, 2022
@rust-log-analyzer

This comment has been minimized.

@camsteffen
Copy link
Contributor Author

@bors r=m-ou-se

@bors
Copy link
Contributor

bors commented Oct 1, 2022

📌 Commit 4f12de0 has been approved by m-ou-se

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 2, 2022

⌛ Testing commit 4f12de0 with merge 91931ec...

@bors
Copy link
Contributor

bors commented Oct 2, 2022

☀️ Test successful - checks-actions
Approved by: m-ou-se
Pushing 91931ec to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 2, 2022
@bors bors merged commit 91931ec into rust-lang:master Oct 2, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 2, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (91931ec): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.2% [3.4%, 5.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.1% [-9.0%, -3.0%] 4
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

@camsteffen camsteffen deleted the is-some-and-by-value branch October 2, 2022 21:28
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…ou-se

Change `is_some_and` to take by value

Consistent with other function-accepting `Option` methods.

Tracking issue: rust-lang#93050

r? `@m-ou-se`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants