0.2.14: fixed a subtle bug in `Naive(Date)Time` addition.

- `NaiveDateTime +/- Duration` or `NaiveTime +/- Duration` could
  have gone wrong when the `Duration` to be added is negative and
  has a fractional second part.

  This was caused by an underflow in the conversion from `Duration`
  to the parts; the lack of tests for this case allowed a bug.
  A regression test has been added to avoid further bugs. (#37)
This commit is contained in:
Kang Seonghoon 2015-05-15 02:17:31 +09:00
parent 5ff21f4077
commit 9cff70bd04
4 changed files with 14 additions and 5 deletions

View File

@ -8,6 +8,15 @@ Chrono obeys the principle of [Semantic Versioning](http://semver.org/).
There were/are numerous minor versions before 1.0 due to the language changes. There were/are numerous minor versions before 1.0 due to the language changes.
Versions with only mechnical changes will be omitted from the following list. Versions with only mechnical changes will be omitted from the following list.
## 0.2.14 (2015-05-15)
### Fixed
- `NaiveDateTime +/- Duration` or `NaiveTime +/- Duration` could have gone wrong
when the `Duration` to be added is negative and has a fractional second part.
This was caused by an underflow in the conversion from `Duration` to the parts;
the lack of tests for this case allowed a bug. (#37)
## 0.2.13 (2015-04-29) ## 0.2.13 (2015-04-29)
### Added ### Added

View File

@ -1,6 +1,6 @@
[package] [package]
name = "chrono" name = "chrono"
version = "0.2.13" version = "0.2.14"
authors = ["Kang Seonghoon <public+rust@mearie.org>"] authors = ["Kang Seonghoon <public+rust@mearie.org>"]
description = "Date and time library for Rust" description = "Date and time library for Rust"

View File

@ -1,4 +1,4 @@
[Chrono][doc] 0.2.13 [Chrono][doc] 0.2.14
==================== ====================
[![Chrono on Travis CI][travis-image]][travis] [![Chrono on Travis CI][travis-image]][travis]
@ -38,7 +38,7 @@ Or in the case you are using Rust 1.0 beta, pin the exact version:
```toml ```toml
[dependencies] [dependencies]
chrono = "=0.2.13" chrono = "=0.2.14"
``` ```
And put this in your crate root: And put this in your crate root:

View File

@ -4,7 +4,7 @@
/*! /*!
# Chrono 0.2.13 # Chrono 0.2.14
Date and time handling for Rust. (also known as `rust-chrono`) Date and time handling for Rust. (also known as `rust-chrono`)
It aims to be a feature-complete superset of the [time](https://github.com/rust-lang/time) library. It aims to be a feature-complete superset of the [time](https://github.com/rust-lang/time) library.
@ -34,7 +34,7 @@ Or in the case you are using Rust 1.0 beta, pin the exact version:
```toml ```toml
[dependencies] [dependencies]
chrono = "=0.2.13" chrono = "=0.2.14"
``` ```
And put this in your crate root: And put this in your crate root: