Skip to content

Commit

Permalink
Merge pull request #653 from chronotope/2018
Browse files Browse the repository at this point in the history
  • Loading branch information
Milo123459 committed Mar 20, 2022
2 parents 323b4b4 + 1004eeb commit ea6412b
Show file tree
Hide file tree
Showing 24 changed files with 184 additions and 185 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test-release.yml
Expand Up @@ -31,10 +31,11 @@ jobs:
- os: ubuntu-latest
rust_version: nightly
- os: ubuntu-18.04
rust_version: 1.13.0
rust_version: 1.32.0
- os: macos-latest
rust_version: 1.13.0
# time doesn't work on windows with 1.13
rust_version: 1.32.0
- os: windows-latest
rust_version: 1.32.0

runs-on: ${{ matrix.os }}

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -39,10 +39,11 @@ jobs:
- os: ubuntu-latest
rust_version: nightly
- os: ubuntu-18.04
rust_version: 1.13.0
rust_version: 1.32.0
- os: macos-latest
rust_version: 1.13.0
# time doesn't work on windows with 1.13
rust_version: 1.32.0
- os: windows-latest
rust_version: 1.32.0

runs-on: ${{ matrix.os }}

Expand Down
12 changes: 4 additions & 8 deletions Cargo.toml
@@ -1,11 +1,6 @@
[package]
name = "chrono"
version = "0.4.19"
authors = [
"Kang Seonghoon <public+rust@mearie.org>",
"Brandon W Maister <quodlibetor@gmail.com>",
]

description = "Date and time library for Rust"
homepage = "https://github.com/chronotope/chrono"
documentation = "https://docs.rs/chrono/"
Expand All @@ -15,6 +10,7 @@ categories = ["date-and-time"]
readme = "README.md"
license = "MIT/Apache-2.0"
exclude = ["/ci/*", "/.travis.yml", "/appveyor.yml", "/Makefile"]
edition = "2018"

[badges]
travis-ci = { repository = "chronotope/chrono" }
Expand All @@ -31,7 +27,7 @@ clock = ["libc", "std", "winapi"]
oldtime = ["time"]
wasmbind = ["wasm-bindgen", "js-sys"]
unstable-locales = ["pure-rust-locales", "alloc"]
__internal_bench = []
__internal_bench = ["criterion"]
__doctest = []

[dependencies]
Expand All @@ -42,6 +38,7 @@ num-traits = { version = "0.2", default-features = false }
rustc-serialize = { version = "0.3.20", optional = true }
serde = { version = "1.0.99", default-features = false, optional = true }
pure-rust-locales = { version = "0.5.2", optional = true }
criterion = { version = "0.3", optional = true }

[target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies]
wasm-bindgen = { version = "0.2", optional = true }
Expand All @@ -55,7 +52,6 @@ serde_json = { version = "1" }
serde_derive = { version = "1", default-features = false }
bincode = { version = "0.8.0" }
num-iter = { version = "0.1.35", default-features = false }
criterion = { version = "0.3" }
doc-comment = { version = "0.3" }

[target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dev-dependencies]
Expand All @@ -74,5 +70,5 @@ harness = false

[[bench]]
name = "serde"
required-features = ["__internal_bench", "serde"]
harness = false
required-features = ["serde"]
1 change: 1 addition & 0 deletions benches/chrono.rs
@@ -1,4 +1,5 @@
//! Benchmarks for chrono that just depend on std
#![cfg(feature = "__internal_bench")]

extern crate chrono;
extern crate criterion;
Expand Down
2 changes: 2 additions & 0 deletions benches/serde.rs
@@ -1,3 +1,5 @@
#![cfg(feature = "__internal_bench")]

extern crate chrono;
extern crate criterion;

Expand Down
12 changes: 6 additions & 6 deletions ci/github.sh
Expand Up @@ -8,7 +8,7 @@ source "${BASH_SOURCE[0]%/*}/_shlib.sh"
TEST_TZS=(ACST-9:30 EST4 UTC0 Asia/Katmandu)
FEATURES=(std serde clock "alloc serde" unstable-locales)
CHECK_FEATURES=(alloc "std unstable-locales" "serde clock" "clock unstable-locales")
RUST_113_FEATURES=(rustc-serialize serde)
RUST_132_FEATURES=(rustc-serialize serde)

main() {
if [[ "$*" =~ "-h" ]]; then
Expand All @@ -29,7 +29,7 @@ meaningful in the github actions feature matrix UI.

runv cargo --version

if [[ ${RUST_VERSION:-} != 1.13.0 ]]; then
if [[ ${RUST_VERSION:-} != 1.32.0 ]]; then
if [[ ${WASM:-} == yes_wasm ]]; then
test_wasm
elif [[ ${WASM:-} == wasm_simple ]]; then
Expand All @@ -43,8 +43,8 @@ meaningful in the github actions feature matrix UI.
else
test_regular UTC0
fi
elif [[ ${RUST_VERSION:-} == 1.13.0 ]]; then
test_113
elif [[ ${RUST_VERSION:-} == 1.32.0 ]]; then
test_132
else
echo "ERROR: didn't run any tests"
exit 1
Expand Down Expand Up @@ -74,9 +74,9 @@ check_combinatoric() {
done
}

test_113() {
test_132() {
runv cargo build --color=always
for feature in "${RUST_113_FEATURES[@]}"; do
for feature in "${RUST_132_FEATURES[@]}"; do
runt cargo build --features "$feature" --color=always
done
}
Expand Down
18 changes: 9 additions & 9 deletions src/date.rs
Expand Up @@ -3,21 +3,21 @@

//! ISO 8601 calendar date with time zone.

use crate::oldtime::Duration as OldDuration;
#[cfg(any(feature = "alloc", feature = "std", test))]
use core::borrow::Borrow;
use core::cmp::Ordering;
use core::ops::{Add, Sub};
use core::{fmt, hash};
use oldtime::Duration as OldDuration;

#[cfg(feature = "unstable-locales")]
use format::Locale;
use crate::format::Locale;
#[cfg(any(feature = "alloc", feature = "std", test))]
use format::{DelayedFormat, Item, StrftimeItems};
use naive::{self, IsoWeek, NaiveDate, NaiveTime};
use offset::{TimeZone, Utc};
use DateTime;
use {Datelike, Weekday};
use crate::format::{DelayedFormat, Item, StrftimeItems};
use crate::naive::{self, IsoWeek, NaiveDate, NaiveTime};
use crate::offset::{TimeZone, Utc};
use crate::DateTime;
use crate::{Datelike, Weekday};

/// ISO 8601 calendar date with time zone.
///
Expand All @@ -36,7 +36,7 @@ use {Datelike, Weekday};
/// the corresponding local date should exist for at least a moment.
/// (It may still have a gap from the offset changes.)
///
/// - The `TimeZone` is free to assign *any* [`Offset`](::offset::Offset) to the
/// - The `TimeZone` is free to assign *any* [`Offset`](crate::offset::Offset) to the
/// local date, as long as that offset did occur in given day.
///
/// For example, if `2015-03-08T01:59-08:00` is followed by `2015-03-08T03:00-07:00`,
Expand Down Expand Up @@ -297,7 +297,7 @@ where
}

/// Formats the date with the specified format string.
/// See the [`::format::strftime`] module
/// See the [`crate::format::strftime`] module
/// on the supported escape sequences.
///
/// # Example
Expand Down

0 comments on commit ea6412b

Please sign in to comment.