Skip to content

Commit

Permalink
Changed structure in preparation for serde
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 5, 2017
1 parent 0b12455 commit ef34105
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ extern crate rustc_serialize;


mod traitdef;
mod traitimpls;
mod diff;
mod recorder;
mod merger;
pub mod value;

pub use traitdef::*;
pub use traitimpls::*;
pub use diff::*;
pub use recorder::*;
pub use merger::*;
5 changes: 0 additions & 5 deletions src/traitimpls/mod.rs

This file was deleted.

3 changes: 3 additions & 0 deletions src/value/json/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

#[cfg(feature = "with-rustc-serialize")]
pub mod rustc_serialize;
File renamed without changes.
1 change: 1 addition & 0 deletions src/value/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod json;
3 changes: 2 additions & 1 deletion tests/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ extern crate treediff;
#[cfg(feature = "with-rustc-serialize")]
mod diff {
extern crate rustc_serialize;
use treediff::{diff, Recorder, JsonKey};
use treediff::{diff, Recorder};
use treediff::value::json::rustc_serialize::JsonKey;
use self::rustc_serialize::json::Json;
use treediff::ChangeType::*;

Expand Down
12 changes: 11 additions & 1 deletion tests/json_value.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
extern crate treediff;

macro_rules! make_suite {
($module:ident) => {
mod $module {

}
};
}

#[cfg(feature = "with-rustc-serialize")]
mod rustc_json_value {
extern crate rustc_serialize;
use treediff::Value;
use treediff::JsonKey;
use treediff::value::json::rustc_serialize::JsonKey;
use self::rustc_serialize::json::Json;

make_suite!(rustc_value);

#[test]
fn scalar_values() {
for v in &["null", "true", "1.23", "-1234456", "1234456", "\"string\""] {
Expand Down

0 comments on commit ef34105

Please sign in to comment.