Skip to content

Commit

Permalink
fix clippy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dean-shaff committed Dec 11, 2024
1 parent db02cf7 commit bbfeb39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ required-features = ["rustls-tls"]

[[example]]
name = "data_types_derive_simple"
required-features = ["time", "uuid"]
required-features = ["time", "uuid", "chrono"]

[[example]]
name = "data_types_variant"
Expand Down
14 changes: 7 additions & 7 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ pub mod chrono {
fn test_serde() {
let now = Utc::now();
let dt = WithDateTime {
dt_nanos: now.clone(),
dt_micros: now.clone(),
dt_millis: now.clone(),
dt_secs: now.clone(),
dt_nanos: now,
dt_micros: now,
dt_millis: now,
dt_secs: now,
};
let serde_dt: WithDateTime =
serde_json::from_str(&serde_json::to_string(&dt).unwrap()).unwrap();
Expand Down Expand Up @@ -371,7 +371,7 @@ pub mod chrono {
#[test]
fn test_serde() {
let now = Utc::now().date_naive();
let dt = WithDate { d: now.clone() };
let dt = WithDate { d: now };
let serde_dt: WithDate =
serde_json::from_str(&serde_json::to_string(&dt).unwrap()).unwrap();
assert!(dt.d == serde_dt.d);
Expand Down Expand Up @@ -437,7 +437,7 @@ pub mod chrono {
#[test]
fn test_serde() {
let now = Utc::now().date_naive();
let dt = WithDate { d_32: now.clone() };
let dt = WithDate { d_32: now };
let serde_dt: WithDate =
serde_json::from_str(&serde_json::to_string(&dt).unwrap()).unwrap();
assert!(dt.d_32 == serde_dt.d_32);
Expand All @@ -447,7 +447,7 @@ pub mod chrono {
fn test_serde_invalid() {
let french_revolution = NaiveDate::from_ymd_opt(1789, 7, 14).unwrap();
let dt = WithDate {
d_32: french_revolution.clone(),
d_32: french_revolution,
};
assert!(serde_json::to_string(&dt).is_err());
}
Expand Down

0 comments on commit bbfeb39

Please sign in to comment.