Skip to content

or_fun_call: lint method calls inside map_or first arg #15074

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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Jun 18, 2025

blocked on #15073

Lint method calls inside map_or too, so for this, lint will be showed:

Some(4).map_or("asd".to_string().len() as i32, f);

previously it worked only for:

Some(4).map_or(slow_fun(), f);

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=bfcda42a6af446e69bc883a8b45eb13c

Sorry for multiple or_fun_call PRs.

changelog: [or_fun_call]: lint method calls inside map_or first arg

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.

1 participant