aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Barnard2018-04-30 13:06:59 +0100
committerEdward Barnard2018-04-30 13:06:59 +0100
commita4963e97eff1fd7d465854f2a5e9a155b60c7ab2 (patch)
treeff76ed20e2cba363c37dc49e6fa249f3372a6480
parent33571d053ee2fa167eb99572a3cef9450ef47ecf (diff)
downloadrust-plist-a4963e97eff1fd7d465854f2a5e9a155b60c7ab2.tar.bz2
Remove dev dependency on chrono.
-rw-r--r--Cargo.toml1
-rw-r--r--src/binary/reader.rs4
-rw-r--r--src/date.rs8
-rw-r--r--src/lib.rs3
-rw-r--r--src/xml/reader.rs4
-rw-r--r--src/xml/writer.rs5
-rw-r--r--tests/tests.rs1
7 files changed, 6 insertions, 20 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 17dd794..34e9807 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,5 +20,4 @@ xml-rs = "0.7.0"
serde = { version = "1.0.2", optional = true }
[dev-dependencies]
-chrono = "0.4.0"
serde_derive = { version = "1.0.2" }
diff --git a/src/binary/reader.rs b/src/binary/reader.rs
index 870dc05..5878836 100644
--- a/src/binary/reader.rs
+++ b/src/binary/reader.rs
@@ -328,7 +328,7 @@ impl<R: Read + Seek> Iterator for EventReader<R> {
#[cfg(test)]
mod tests {
- use chrono::{TimeZone, Utc};
+ use humantime::parse_rfc3339_weak;
use std::fs::File;
use std::path::Path;
@@ -355,7 +355,7 @@ mod tests {
StringValue("Height".to_owned()),
RealValue(1.60),
StringValue("Birthdate".to_owned()),
- DateValue(Date::from_chrono(Utc.ymd(1981, 05, 16).and_hms(11, 32, 06))),
+ DateValue(parse_rfc3339_weak("1981-05-16 11:32:06").unwrap().into()),
StringValue("Author".to_owned()),
StringValue("William Shakespeare".to_owned()),
StringValue("Data".to_owned()),
diff --git a/src/date.rs b/src/date.rs
index 6f2e0cb..509dfac 100644
--- a/src/date.rs
+++ b/src/date.rs
@@ -3,9 +3,6 @@ use std::fmt;
use std::result::Result as StdResult;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
-#[cfg(test)]
-use chrono::{DateTime, Utc};
-
use {Error, Result};
/// A UTC timestamp. Used for serialization to and from the plist date type.
@@ -50,11 +47,6 @@ impl Date {
Ok(Date { inner })
}
-
- #[cfg(test)]
- pub(crate) fn from_chrono(date: DateTime<Utc>) -> Date {
- Date { inner: date.into() }
- }
}
impl fmt::Debug for Date {
diff --git a/src/lib.rs b/src/lib.rs
index be1f4d7..22cd9a8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -63,9 +63,6 @@ extern crate byteorder;
extern crate humantime;
extern crate xml as xml_rs;
-#[cfg(test)]
-extern crate chrono;
-
pub mod binary;
pub mod xml;
diff --git a/src/xml/reader.rs b/src/xml/reader.rs
index c1c2b3b..6642d59 100644
--- a/src/xml/reader.rs
+++ b/src/xml/reader.rs
@@ -148,7 +148,7 @@ impl<R: Read> Iterator for EventReader<R> {
#[cfg(test)]
mod tests {
- use chrono::{TimeZone, Utc};
+ use humantime::parse_rfc3339_weak;
use std::fs::File;
use std::path::Path;
@@ -179,7 +179,7 @@ mod tests {
StringValue("Data".to_owned()),
DataValue(vec![0, 0, 0, 190, 0, 0, 0, 3, 0, 0, 0, 30, 0, 0, 0]),
StringValue("Birthdate".to_owned()),
- DateValue(Date::from_chrono(Utc.ymd(1981, 05, 16).and_hms(11, 32, 06))),
+ DateValue(parse_rfc3339_weak("1981-05-16 11:32:06").unwrap().into()),
StringValue("Blank".to_owned()),
StringValue("".to_owned()),
EndDictionary,
diff --git a/src/xml/writer.rs b/src/xml/writer.rs
index 77ccd87..67bb6a2 100644
--- a/src/xml/writer.rs
+++ b/src/xml/writer.rs
@@ -188,10 +188,9 @@ impl<W: Write> PlistEventWriter for EventWriter<W> {
#[cfg(test)]
mod tests {
- use chrono::{TimeZone, Utc};
+ use humantime::parse_rfc3339_weak;
use std::io::Cursor;
- use Date;
use super::*;
#[test]
@@ -214,7 +213,7 @@ mod tests {
StringValue("Data".to_owned()),
DataValue(vec![0, 0, 0, 190, 0, 0, 0, 3, 0, 0, 0, 30, 0, 0, 0]),
StringValue("Birthdate".to_owned()),
- DateValue(Date::from_chrono(Utc.ymd(1981, 05, 16).and_hms(11, 32, 06))),
+ DateValue(parse_rfc3339_weak("1981-05-16 11:32:06").unwrap().into()),
EndDictionary,
];
diff --git a/tests/tests.rs b/tests/tests.rs
index 41bbfd5..8754b09 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -1,4 +1,3 @@
-extern crate chrono;
extern crate plist;
#[cfg(feature = "serde")]