Skip to content

Commit

Permalink
refactor(report): Switch to swrde derive feature
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 7, 2019
1 parent 3419a8d commit a129fb3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[macro_use]
extern crate serde_derive;

mod dict;
mod dict_codegen;

Expand Down
8 changes: 4 additions & 4 deletions src/report.rs
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -28,14 +28,14 @@ impl<'m> From<FilenameCorrection<'m>> 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)]
Expand All @@ -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,
Expand Down

0 comments on commit a129fb3

Please sign in to comment.