From a129fb3d657a6fce8c4ac3e2da2f90334e409875 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 7 Aug 2019 08:16:22 -0500 Subject: [PATCH] refactor(report): Switch to swrde derive feature --- Cargo.lock | 4 +++- Cargo.toml | 3 +-- src/lib.rs | 3 --- src/report.rs | 8 ++++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d13e961..ec288fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -651,6 +651,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "serde" version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "serde_derive" @@ -807,7 +810,6 @@ dependencies = [ "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 921ec74..9f4d73e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,8 +28,7 @@ ignore = "0.4" phf = { version = "0.7", features = ["unicase"] } regex = "1.0" lazy_static = "1.2.0" -serde = "1.0" -serde_derive = "1.0" +serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" itertools = "0.8" unicase = "1.1" diff --git a/src/lib.rs b/src/lib.rs index b5201df..2c3fd94 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,3 @@ -#[macro_use] -extern crate serde_derive; - mod dict; mod dict_codegen; diff --git a/src/report.rs b/src/report.rs index 23b5c47..70ac51c 100644 --- a/src/report.rs +++ b/src/report.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use std::io::{self, Write}; -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[serde(tag = "type")] pub enum Message<'m> { @@ -28,14 +28,14 @@ impl<'m> From> for Message<'m> { } } -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, serde::Serialize)] pub struct BinaryFile<'m> { pub path: &'m std::path::Path, #[serde(skip)] pub(crate) non_exhaustive: (), } -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, serde::Serialize)] pub struct Correction<'m> { pub path: &'m std::path::Path, #[serde(skip)] @@ -48,7 +48,7 @@ pub struct Correction<'m> { pub(crate) non_exhaustive: (), } -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, serde::Serialize)] pub struct FilenameCorrection<'m> { pub path: &'m std::path::Path, pub typo: &'m str,