Giter Site home page Giter Site logo

Comments (9)

dbrgn avatar dbrgn commented on May 3, 2024 7

Could we switch from re-exporting the external time::Duration to using std::time::Duration directly?

from chrono.

mqudsi avatar mqudsi commented on May 3, 2024 5

Is it possible to drop time::Duration entirely now that there is a stable std::time::Duration? Is there a roadmap for std compatibility?

from chrono.

lifthrasiir avatar lifthrasiir commented on May 3, 2024 1

This is a non-trivial breaking change that is planned in 0.3. In part, std::time::Duration is never negative while time::Duration allows negative; this requires minor but significant interface changes. For now you need to use time::Duration::{from,to}_std methods to convert between them.

from chrono.

Procrat avatar Procrat commented on May 3, 2024 1

I would like to be able to use the implementation of the Hash trait, which is defined for std::time::Duration, but which apparently is not available for chrono::Duration.

from chrono.

H2CO3 avatar H2CO3 commented on May 3, 2024 1

@lifthrasiir What is the state of this? Chrono is already at 0.4 yet the usage of (old)time::Duration remains prevalent. It would be really good if it weren't a pain to use one of Chrono's core data types. Also the dependence on (old)time and rustc-serialize seems dubious: those libraries are deprecated and are no longer supported. As such, they should not be depended upon.

from chrono.

marjakm avatar marjakm commented on May 3, 2024

+1

from chrono.

dtolnay avatar dtolnay commented on May 3, 2024

@pantaloons and I just ran into this in #serde. The standard library std::time::Duration works with Serde but time::Duration (and therefore chrono::Duration) does not.

from chrono.

0xpr03 avatar 0xpr03 commented on May 3, 2024

This really is a hassle now, I can't convert a NaiveTime to a Duration at all and the 0.4 broke my workaround (which was essentially to just do some meaningless calculation-function which returned the right type). Now we've a golden cage state..

from chrono.

pitdicker avatar pitdicker commented on May 3, 2024

Closing as a duplicate of #497.

from chrono.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.