Skip to content
This repository was archived by the owner on Jul 19, 2020. It is now read-only.
This repository was archived by the owner on Jul 19, 2020. It is now read-only.

Add a then_with shim #35

Description

@hgzimmerman

There is currently a nightly feature for then and then_with functions on bools that allow them to be turned into Options using a provided value or closure.
This in conjunction with unwrap_or_default can be used to easily write "show this html or nothing" sections.

A stable shim trait for this could be added to this crate, have it live in experimental, and then remove it once the actual feature stabilizes.

https://doc.rust-lang.org/std/primitive.bool.html#method.then_with

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions