Skip to content

Suggest replacing .map(f).flatten() with .and_then(f) on Options #6870

Closed
@scottmcm

Description

@scottmcm

What it does

What does this lint do?
Checks for usage of _.map(_).flatten(),

This is like https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten but for Options instead of Iterators

Categories (optional)

  • Kind: clippy::style/complexity

Easier to follow what's happening, shorter

Drawbacks

None.

Example

Inspired by @steffahn's suggestion in Nadrieril/dhall-rust#213 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-documentationArea: Adding or improving documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions