Skip to content

Adding is_zero() to core::time::Duration #2809

@ghost

Description

Hello Rust developers,

I apologize beforehand because I think this is a simple RFC, so I'm not going through full requirements of an RFC issue.

Would you please consider adding new function (below) to core::time::Duration?

/// # Checks if this duration is zero
pub fn is_zero(&self) -> bool;

When taking options from users, I find myself many times the need to check if a duration is zero. Perhaps it could be the same for other developers.

Thank you very much for your hard work,

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-timeProposals relating to time & dates.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.

    Type

    No type
    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