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

manual_map recommends noncompilable code involving async code #6819

Closed
bugadani opened this issue Mar 1, 2021 · 0 comments · Fixed by #6801
Closed

manual_map recommends noncompilable code involving async code #6819

bugadani opened this issue Mar 1, 2021 · 0 comments · Fixed by #6801
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@bugadani
Copy link
Contributor

bugadani commented Mar 1, 2021

Lint name: manual_map

I tried this code:

async fn some_async_operation(u: u32) -> u32 {
    // This doesn't matter
    u
}

async fn some_operation(opt: Option<u32>) -> Option<u32> {
    match opt {
        Some(data) => Some(some_async_operation(data).await),
        None => None,
    }
}

I expected to see this happen: no manual_map lint

Instead, this happened: help: try this: `opt.map(|sender| some_async_operation(data).await)`

Meta

  • cargo clippy -V: clippy 0.1.52 (98f8cce 2021-02-25)
  • rustc -Vv:
    rustc 1.52.0-nightly (98f8cce6d 2021-02-25)
    binary: rustc
    commit-hash: 98f8cce6db6c6c6660eeffee2b3903104e547ecf
    commit-date: 2021-02-25
    host: x86_64-unknown-linux-gnu
    release: 1.52.0-nightly
    LLVM version: 11.0.1
    
@bugadani bugadani added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Mar 1, 2021
@bors bors closed this as completed in ece3543 Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant