From 771ad94dddc92480744c21d611f170148c93ae68 Mon Sep 17 00:00:00 2001 From: metent Date: Wed, 15 Jun 2022 19:36:33 +0530 Subject: [PATCH 1/3] Remove unused libc dependency from Cargo.toml --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9e2370d071..dadbe25401 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ name = "chrono" default = ["clock", "std", "oldtime"] alloc = [] std = [] -clock = ["libc", "std", "winapi"] +clock = ["std", "winapi"] oldtime = ["time"] wasmbind = ["wasm-bindgen", "js-sys"] unstable-locales = ["pure-rust-locales", "alloc"] @@ -31,7 +31,6 @@ __internal_bench = ["criterion"] __doctest = [] [dependencies] -libc = { version = "0.2.69", optional = true } time = { version = "0.1.43", optional = true } num-integer = { version = "0.1.36", default-features = false } num-traits = { version = "0.2", default-features = false } From 0b428e26bd2715de24b9ed676d73b437f66e3c0e Mon Sep 17 00:00:00 2001 From: metent Date: Thu, 16 Jun 2022 18:20:13 +0530 Subject: [PATCH 2/3] Add libc feature to prevent potentially breaking change --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index dadbe25401..2f749fcc0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ name = "chrono" [features] default = ["clock", "std", "oldtime"] alloc = [] +libc = [] std = [] clock = ["std", "winapi"] oldtime = ["time"] From 502cfac8607b80c0291e79933dd5e88875484482 Mon Sep 17 00:00:00 2001 From: Rishabh Das Date: Thu, 16 Jun 2022 18:47:55 +0530 Subject: [PATCH 3/3] Document libc dependency removal --- CHANGELOG.md | 1 + README.md | 4 ++-- src/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a1a3bd19..b29520ef99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ Versions with only mechanical changes will be omitted from the following list. * Implement `DoubleEndedIterator` for `NaiveDateDaysIterator` and `NaiveDateWeeksIterator` * Fix panicking when parsing a `DateTime` (@botahamec) * Add support for getting week bounds based on a specific `NaiveDate` and a `Weekday` (#666) +* Remove libc dependency from Cargo.toml. ## 0.4.19 diff --git a/README.md b/README.md index 8ae4aa08e7..59d4eb7139 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ Default features: - `std`: Enables functionality that depends on the standard library. This is a superset of `alloc` and adds interoperation with standard library types and traits. -- `clock`: enables reading the system time (`now`), independent of whether - `std::time::SystemTime` is present, depends on having a libc. +- `clock`: Enables reading the system time (`now`) that depends on the standard library for +UNIX-like operating systems and the Windows API (`winapi`) for Windows. Optional features: diff --git a/src/lib.rs b/src/lib.rs index 1bd4bb937a..b68a25bead 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,8 +42,8 @@ //! - `std`: Enables functionality that depends on the standard library. This //! is a superset of `alloc` and adds interoperation with standard library types //! and traits. -//! - `clock`: enables reading the system time (`now`), independent of whether -//! `std::time::SystemTime` is present, depends on having a libc. +//! - `clock`: Enables reading the system time (`now`) that depends on the standard library for +//! UNIX-like operating systems and the Windows API (`winapi`) for Windows. //! //! Optional features: //!