Skip to content

fix: Compiler warning about unused map_or #7508

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

Merged
merged 1 commit into from
Sep 19, 2023
Merged

fix: Compiler warning about unused map_or #7508

merged 1 commit into from
Sep 19, 2023

Conversation

MichaReiser
Copy link
Member

Summary

Fixes a compile error about an unused map_or return value by rewritting the statement to if let Some(..) = .. {}

Test Plan

cargo test

@MichaReiser
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Sep 19, 2023
@MichaReiser MichaReiser enabled auto-merge (squash) September 19, 2023 07:59
@MichaReiser MichaReiser merged commit 37b7d0f into main Sep 19, 2023
@MichaReiser MichaReiser deleted the fix-map-or branch September 19, 2023 08:10
@github-actions
Copy link
Contributor

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

@mkniewallner
Copy link
Contributor

Sorry for that. Out of curiosity since I'm new to Rust, how could have I had spotted that? Isn't it something that is reported on the CI?

@MichaReiser
Copy link
Member Author

Sorry for that. Out of curiosity since I'm new to Rust, how could have I had spotted that? Isn't it something that is reported on the CI?

No worries. I saw the message when running cargo build or cargo test locally. But I'm also using Rust's nightly compiler. So it's quite possible that the warning message is new and not something you could have seen.

@konstin
Copy link
Member

konstin commented Sep 19, 2023

Rust makes it easy to even find the PR where this was introduced: https://github.com/rust-lang/rust/pulls?q=is%3Apr+is%3Aclosed+map_or points to rust-lang/rust#112655. Given this was merged for rust 1.73, we can expect it to become available on stable 2023-10-05 (https://releases.rs/).

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

Successfully merging this pull request may close these issues.

3 participants