summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDidier Wenzek <didier.wenzek@acidalie.com>2022-07-26 17:55:24 +0200
committerGitHub <noreply@github.com>2022-07-26 17:55:24 +0200
commit45b220f537d6a6c92772822927a432621e28438f (patch)
tree6feb5d782c0b827a65211dbe49754a5c086fe974
parentf39825fbed5772511340f1f6aca3ed927eea837b (diff)
parent22815713097a3ccded00355076a7d710572d3187 (diff)
Merge pull request #1298 from matthiasbeyer/remove-clock-serde
Remove "serde" module in "clock" crate
-rw-r--r--crates/common/clock/Cargo.toml1
-rw-r--r--crates/common/clock/src/lib.rs3
-rw-r--r--crates/common/clock/src/serde/mod.rs1
-rw-r--r--crates/common/clock/src/serde/rfc3339.rs6
-rw-r--r--crates/core/thin_edge_json/Cargo.toml4
-rw-r--r--crates/core/thin_edge_json/src/alarm.rs2
-rw-r--r--crates/core/thin_edge_json/src/event.rs2
7 files changed, 4 insertions, 15 deletions
diff --git a/crates/common/clock/Cargo.toml b/crates/common/clock/Cargo.toml
index 0ebfeedc..751075d3 100644
--- a/crates/common/clock/Cargo.toml
+++ b/crates/common/clock/Cargo.toml
@@ -11,4 +11,3 @@ time = "0.3.7"
[features]
default = []
-with-serde = ["time/serde-well-known"]
diff --git a/crates/common/clock/src/lib.rs b/crates/common/clock/src/lib.rs
index a97ee9df..0fe36f2e 100644
--- a/crates/common/clock/src/lib.rs
+++ b/crates/common/clock/src/lib.rs
@@ -1,9 +1,6 @@
use mockall::automock;
use time::OffsetDateTime;
-#[cfg(feature = "with-serde")]
-pub mod serde;
-
pub type Timestamp = OffsetDateTime;
#[automock]
diff --git a/crates/common/clock/src/serde/mod.rs b/crates/common/clock/src/serde/mod.rs
deleted file mode 100644
index a1646141..00000000
--- a/crates/common/clock/src/serde/mod.rs
+++ /dev/null
@@ -1 +0,0 @@
-pub mod rfc3339;
diff --git a/crates/common/clock/src/serde/rfc3339.rs b/crates/common/clock/src/serde/rfc3339.rs
deleted file mode 100644
index abb36da6..00000000
--- a/crates/common/clock/src/serde/rfc3339.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-/// Re-exported module
-///
-/// Use this module in combination with serde's [`#[with]`][with] attribute.
-///
-/// [with]: https://serde.rs/field-attrs.html#with
-pub use time::serde::rfc3339::option;
diff --git a/crates/core/thin_edge_json/Cargo.toml b/crates/core/thin_edge_json/Cargo.toml
index df8f8acc..77602b38 100644
--- a/crates/core/thin_edge_json/Cargo.toml
+++ b/crates/core/thin_edge_json/Cargo.toml
@@ -8,12 +8,12 @@ rust-version = "1.58.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-clock = { path = "../../common/clock", features = ["with-serde"] }
+clock = { path = "../../common/clock" }
json-writer = { path = "../../common/json_writer" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
thiserror = "1.0"
-time = { version = "0.3", features = ["formatting", "local-offset", "parsing", "serde"] }
+time = { version = "0.3", features = ["formatting", "local-offset", "parsing", "serde", "serde-well-known"] }
[dev-dependencies]
anyhow = "1.0"
diff --git a/crates/core/thin_edge_json/src/alarm.rs b/crates/core/thin_edge_json/src/alarm.rs
index 91167108..9029d673 100644
--- a/crates/core/thin_edge_json/src/alarm.rs
+++ b/crates/core/thin_edge_json/src/alarm.rs
@@ -25,7 +25,7 @@ pub struct ThinEdgeAlarmData {
pub text: Option<String>,
#[serde(default)]
- #[serde(with = "clock::serde::rfc3339::option")]
+ #[serde(with = "time::serde::rfc3339::option")]
pub time: Option<Timestamp>,
}
diff --git a/crates/core/thin_edge_json/src/event.rs b/crates/core/thin_edge_json/src/event.rs
index 8e07625f..20052f0e 100644
--- a/crates/core/thin_edge_json/src/event.rs
+++ b/crates/core/thin_edge_json/src/event.rs
@@ -22,7 +22,7 @@ pub struct ThinEdgeEventData {
pub text: Option<String>,
#[serde(default)]
- #[serde(with = "clock::serde::rfc3339::option")]
+ #[serde(with = "time::serde::rfc3339::option")]
pub time: Option<Timestamp>,
#[serde(flatten)]