mirror of
https://github.com/bspeice/dtparse
synced 2024-12-22 04:18:09 -05:00
Add old rust versions to test agains
This commit is contained in:
parent
48705339e6
commit
4d48885f4b
17
.travis.yml
17
.travis.yml
@ -74,6 +74,23 @@ matrix:
|
|||||||
os: osx
|
os: osx
|
||||||
rust: beta
|
rust: beta
|
||||||
|
|
||||||
|
# Historical Rust versions
|
||||||
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
rust: 1.21.0
|
||||||
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
rust: 1.22.0
|
||||||
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
rust: 1.23.0
|
||||||
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
rust: 1.24.0
|
||||||
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
rust: 1.25.0
|
||||||
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
rust: 1.26.0
|
||||||
|
- env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
rust: 1.27.0
|
||||||
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- set -e
|
- set -e
|
||||||
- rustup self update
|
- rustup self update
|
||||||
|
@ -65,5 +65,11 @@ assert_eq!(
|
|||||||
|
|
||||||
Further examples can be found in the [examples](examples) directory on international usage.
|
Further examples can be found in the [examples](examples) directory on international usage.
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
`dtparse` requires a minimum Rust version of 1.21 to build, but is tested on Windows, OSX,
|
||||||
|
BSD, and Linux. The build is also compiled against the iOS and Android SDK's, but is not
|
||||||
|
tested against them.
|
||||||
|
|
||||||
[dateutil]: https://github.com/dateutil/dateutil
|
[dateutil]: https://github.com/dateutil/dateutil
|
||||||
[examples]: https://github.com/bspeice/dtparse/tree/master/examples
|
[examples]: https://github.com/bspeice/dtparse/tree/master/examples
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//! sense of the dates and times they contain. A couple of quick examples
|
//! sense of the dates and times they contain. A couple of quick examples
|
||||||
//! from the test cases should give some context:
|
//! from the test cases should give some context:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust,ignore (tests-dont-compile-on-old-rust)
|
||||||
//! # extern crate chrono;
|
//! # extern crate chrono;
|
||||||
//! # extern crate dtparse;
|
//! # extern crate dtparse;
|
||||||
//! use chrono::prelude::*;
|
//! use chrono::prelude::*;
|
||||||
@ -34,7 +34,7 @@
|
|||||||
//! And we can even handle fuzzy strings where dates/times aren't the
|
//! And we can even handle fuzzy strings where dates/times aren't the
|
||||||
//! only content if we dig into the implementation a bit!
|
//! only content if we dig into the implementation a bit!
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust,ignore (tests-dont-compile-on-old-rust)
|
||||||
//! # extern crate chrono;
|
//! # extern crate chrono;
|
||||||
//! # extern crate dtparse;
|
//! # extern crate dtparse;
|
||||||
//! use chrono::prelude::*;
|
//! use chrono::prelude::*;
|
||||||
|
@ -16,13 +16,13 @@ impl DayOfWeek {
|
|||||||
|
|
||||||
pub fn to_numeral(&self) -> u32 {
|
pub fn to_numeral(&self) -> u32 {
|
||||||
match self {
|
match self {
|
||||||
DayOfWeek::Sunday => 0,
|
&DayOfWeek::Sunday => 0,
|
||||||
DayOfWeek::Monday => 1,
|
&DayOfWeek::Monday => 1,
|
||||||
DayOfWeek::Tuesday => 2,
|
&DayOfWeek::Tuesday => 2,
|
||||||
DayOfWeek::Wednesday => 3,
|
&DayOfWeek::Wednesday => 3,
|
||||||
DayOfWeek::Thursday => 4,
|
&DayOfWeek::Thursday => 4,
|
||||||
DayOfWeek::Friday => 5,
|
&DayOfWeek::Friday => 5,
|
||||||
DayOfWeek::Saturday => 6,
|
&DayOfWeek::Saturday => 6,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user