Comments (9)
Could we switch from re-exporting the external time::Duration
to using std::time::Duration
directly?
from chrono.
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.
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.
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.
@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.
+1
from chrono.
@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.
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.
Closing as a duplicate of #497.
from chrono.
Related Issues (20)
- Mark `format::Numeric` and `format::Fixed` as `non_exhaustive` HOT 5
- Supporting normalising dates/times HOT 4
- Recognize our review capacity is limited for non-trivial work HOT 7
- Help understanding Parsing error: NotEnough while using parse_from_str HOT 3
- Differences between this crate and `time` HOT 12
- Properly support padding in parsers HOT 2
- Consider reverting #807 on the 0.5 branch HOT 1
- Inconsistent crate features documentation HOT 2
- `Utc::now` can fail with dates that are very far into the past/future HOT 1
- RFC: add feature "abi_stable" and make types abi stable HOT 7
- Is there a simpler way to get the current date at a specific time? HOT 3
- 0.5.x: Timezone conversion result (`LocalResult`) HOT 39
- `DateTime` equality with different `Offset`s HOT 6
- Tracking issue: Converting the API to return `Result`s HOT 11
- Deprecate all timestamp-related methods on `NaiveDateTime` HOT 1
- `TimeDelta::num_microseconds` (?)
- Panic with TZ="pBB24" HOT 1
- Deserializing DateTime from unix timestamp is not implemented, despite description HOT 1
- Ergonomic replacements for panicking APIs. HOT 11
- function Utc::now().checked_add_signed raised wrong error HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrono.