Skip to content

Ergonomic replacements for panicking APIs. #1491

Description

@turalcar

When a lot of panicking APIs, such as NaiveDate::from_ymd() were deprecated I thought it to be a momentary aberration and locked the version at 0.4.22. A year has passed and proven me wrong.
I replaced .pred().pred() with - Duration::days(2) and now that's deprecated too.
In all of my code from_ymd(), from_hms() etc were only used ever with literals. I don't think that's uncommon. One could try to enforce that with a macro (e. g. date!(2024, 3, 6) similarly to how print!("Hi") only accepts string literals).
Whatever a good replacement is, it should've been implemented before the old version was deprecated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions