Skip to content

Time v0.3 tracking issue #248

@jhpratt

Description

@jhpratt

Time v0.2 was an outstanding learning experience, and by all accounts is a massive improvement over v0.1. However, a number of ill-informed decisions were made which led to some inconsistencies and many deprecated APIs.

All deprecated methods and structs have ready-to-use alternatives, which will be detailed before a release. As such, I would like to remove all deprecated APIs. This currently includes the following.

Deprecated APIs
  • v0.1 APIs, currently behind a default feature flag
    • PreciseTime
    • SteadyTime
    • precise_time_ns
    • precise_time_s
    • Instant::to
    • Duration::num_weeks
    • Duration::num_days
    • Duration::num_hours
    • Duration::num_minutes
    • Duration::num_seconds
    • Duration::num_milliseconds
    • Duration::num_microseconds
    • Duration::num_nanoseconds
    • Duration::span
    • Duration::from_std
    • Duration::to_std
  • Panicking APIs, currently behind a non-default feature flag
    • Date::from_ymd
    • Date::from_yo
    • Date::from_iso_ywd
    • Date::with_hms
    • Date::with_hms_milli
    • Date::with_hms_micro
    • Date::with_hms_nano
    • Time::from_hms
    • Time::from_hms_milli
    • Time::from_hms_micro
    • Time::from_hms_nano
  • APIs that assume an offset of UTC, currently enabled unconditionally
    • Date::today
    • Time::now
    • PrimitiveDateTime::now
    • PrimitiveDateTime::unix_epoch
    • PrimitiveDateTime::from_unix_timestamp
    • PrimitiveDateTime::timestamp
    • OffsetDateTime::now
  • Other APIs that were deprecated during the course of v0.2, currently enabled unconditionally
    • Sign
    • Duration::sign
    • PrimitiveDateTime::using_offset

Goals for v0.3:

  • Remove all deprecated APIs
  • Revamped parsing/formatting (Revamped parsing/formatting #236)
  • un-constify is_leap_year and days_in_year for performance. On Rust ≥ 1.46, cfg_if_match and cfg_loop are stable, which allows re-enabling this without runtime performance loss. As a result, the only "loss" is un-constifying methods on older compilers.
  • Place macros behind a feature flag.
  • Change a number of methods to return Result, including all UtcOffset constructors.
  • Rename try_from_* to just from_*.
  • #![no_alloc] support
  • Rename OffsetDateTime::timestamp and OffsetDateTime::timestamp_nanos to OffsetDateTime::unix_timestamp and OffsetDateTime::unix_timestamp_nanos respectively.
  • Stabilize serde representations

Anything stricken on the above list is completed. Anything that was previously on the list but was removed was either done in 0.2 (if it's not a breaking change) or abandoned.

Metadata

Metadata

Assignees

Labels

A-coreArea: anything not otherwise coveredA-formattingArea: formattingA-macrosArea: macrosA-parsingArea: parsingC-cleanupCategory: cleanup of existing codeC-seeking-input 📣Category: community input is desiredC-tracking-issueCategory: tracking issue for a feature/release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions