Skip to content

Commit

Permalink
replace crate json by serde_json
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocodutra committed Sep 11, 2022
1 parent 5852ef5 commit caaff73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pathfinding = "3.0.9"
[dev-dependencies]
assert_matches = "1.5.0"
criterion = "0.3.5"
json = "0.12.4"
proptest = "1.0.0"
serde_json = "1.0.85"
test-strategy = "0.2.0"

[lib]
Expand Down
22 changes: 10 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//!
//! ```rust
//! use tree_edit_distance::*;
//! # use json::{object, JsonValue};
//! use std::mem::{discriminant, Discriminant};
//! use std::iter::empty;
//!
Expand Down Expand Up @@ -48,19 +47,18 @@
//! }
//! }
//! #
//! # impl From<JsonValue> for Json {
//! # fn from(obj: JsonValue) -> Self {
//! # use JsonValue::*;
//! # impl From<serde_json::Value> for Json {
//! # fn from(obj: serde_json::Value) -> Self {
//! # use serde_json::Value::*;
//! # match obj {
//! # Null => Json::Null,
//! # Boolean(b) => Json::Bool(b),
//! # Number(n) => Json::Number(n.into()),
//! # Short(s) => Json::String(s.into()),
//! # Bool(b) => Json::Bool(b),
//! # Number(n) => Json::Number(n.as_i64().unwrap() as f64),
//! # String(s) => Json::String(s),
//! # Array(a) => Json::Array(a.into_iter().map(Into::into).collect()),
//! # Object(m) => Json::Map(
//! # m.iter()
//! # .map(|(k, v)| (k.into(), v.clone().into()))
//! # m.into_iter()
//! # .map(|(k, v)| (k, v.into()))
//! # .collect(),
//! # ),
//! # }
Expand All @@ -70,7 +68,7 @@
//! macro_rules! json {
//! ($( $tokens:tt )*) => {
//! // ...
//! # Json::from(object!($($tokens)*))
//! # Json::from(::serde_json::json!({$($tokens)*}))
//! };
//! }
//!
Expand Down Expand Up @@ -98,8 +96,8 @@
//!
//! assert_eq!(&*edits, &[
//! Edit::Replace(Box::new([
//! Edit::Insert, // "name"
//! Edit::Replace(Box::default()), // "maiden name"
//! Edit::Replace(Box::default()), // "name"
//! Edit::Insert, // "maiden name"
//! Edit::Replace(Box::default()), // "age"
//! Edit::Replace(Box::new([ // "phones"
//! Edit::Remove,
Expand Down

0 comments on commit caaff73

Please sign in to comment.