summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2022-12-18 11:51:11 +0100
committerMatthias Beyer <mail@beyermatthias.de>2022-12-18 12:07:01 +0100
commitdfb53dd0b1b2d887ad6d1f9de198eeb1fdc13390 (patch)
tree6578984610d89d4b7e9463e69ef6501e0e85e53a
parent502321914005b101fa8bae7e979453876bc9c64b (diff)
Replace serde_derive with serde and derive feature
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--Cargo.toml3
-rw-r--r--src/annotation.rs2
-rw-r--r--src/import.rs2
-rw-r--r--src/lib.rs1
-rw-r--r--src/status.rs2
-rw-r--r--src/tw.rs2
6 files changed, 5 insertions, 7 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f168f8f..96bb7c7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,8 +21,7 @@ maintenance = { status = "passively-maintained" }
[dependencies]
chrono = "0.4"
-serde = "1"
-serde_derive = "1"
+serde = { version = "1", features = ["derive"] }
serde_json = "1"
uuid = { version = "1.2", features = ["serde", "v4"] }
log = "0.4"
diff --git a/src/annotation.rs b/src/annotation.rs
index a4e5b76..6f5a4e0 100644
--- a/src/annotation.rs
+++ b/src/annotation.rs
@@ -11,7 +11,7 @@ use crate::date::Date;
/// Annotation type for task annotations.
/// Each annotation in taskwarrior consists of a date and a description,
/// the date is named "entry", the description "description" in the JSON export.
-#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
+#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq)]
pub struct Annotation {
entry: Date,
description: String,
diff --git a/src/import.rs b/src/import.rs
index 64ed423..19acd0e 100644
--- a/src/import.rs
+++ b/src/import.rs
@@ -131,10 +131,10 @@ fn test_two() {
#[test]
fn test_one_single() {
- use chrono::NaiveDateTime;
use crate::date::Date;
use crate::date::TASKWARRIOR_DATETIME_TEMPLATE;
use crate::status::TaskStatus;
+ use chrono::NaiveDateTime;
use uuid::Uuid;
fn mkdate(s: &str) -> Date {
let n = NaiveDateTime::parse_from_str(s, TASKWARRIOR_DATETIME_TEMPLATE);
diff --git a/src/lib.rs b/src/lib.rs
index edf9a24..3bca993 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -46,7 +46,6 @@
extern crate chrono;
extern crate serde;
#[macro_use]
-extern crate serde_derive;
extern crate serde_json;
extern crate uuid;
#[macro_use]
diff --git a/src/status.rs b/src/status.rs
index 145b39d..f049983 100644
--- a/src/status.rs
+++ b/src/status.rs
@@ -9,7 +9,7 @@
use std::fmt::{Display, Error as FmtError, Formatter};
/// Enum for status taskwarrior supports.
-#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
+#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
pub enum TaskStatus {
/// Pending status type
#[serde(rename = "pending")]
diff --git a/src/tw.rs b/src/tw.rs
index dea6b07..0a4f1d9 100644
--- a/src/tw.rs
+++ b/src/tw.rs
@@ -10,10 +10,10 @@
use crate::error::ErrorKind as EK;
use crate::import::import;
+use crate::task::Task;
use std::io::Write;
use std::iter::once;
use std::process::{Child, Command, Stdio};
-use crate::task::Task;
use failure::Fallible as Result;
use failure::ResultExt;