From 5d463b2af780d31b29ae42c3f1b4475d3852177b Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 23 Oct 2021 04:47:17 +0200 Subject: [PATCH] Remove serde_json from egui dev-dependencies --- Cargo.lock | 1 - egui/Cargo.toml | 3 --- egui/src/any/serializable/any_map.rs | 8 ++++---- egui/src/any/serializable/type_map.rs | 8 ++++---- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04a9e8e0c..a0d89412b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -855,7 +855,6 @@ dependencies = [ "nohash-hasher", "ron", "serde", - "serde_json", ] [[package]] diff --git a/egui/Cargo.toml b/egui/Cargo.toml index d7b8058ee..41e7b0fd6 100644 --- a/egui/Cargo.toml +++ b/egui/Cargo.toml @@ -61,6 +61,3 @@ convert_bytemuck = ["epaint/convert_bytemuck"] # from multiple threads. It comes with a minor performance impact. single_threaded = ["epaint/single_threaded"] multi_threaded = ["epaint/multi_threaded"] - -[dev-dependencies] -serde_json = "1" diff --git a/egui/src/any/serializable/any_map.rs b/egui/src/any/serializable/any_map.rs index 325ff867e..b7bad87d1 100644 --- a/egui/src/any/serializable/any_map.rs +++ b/egui/src/any/serializable/any_map.rs @@ -111,10 +111,10 @@ impl IdAnyMap { // let file_string = { // let mut map: AnyMap = Default::default(); // map.insert(1, State1 { a: 42 }); -// serde_json::to_string(&map).unwrap() +// ron::to_string(&map).unwrap() // }; -// let mut map: AnyMap = serde_json::from_str(&file_string).unwrap(); +// let mut map: AnyMap = ron::from_str(&file_string).unwrap(); // assert!(map.get::(&1).is_none()); // assert_eq!(map.get::(&1), Some(&State1 { a: 42 })); // } @@ -139,10 +139,10 @@ impl IdAnyMap { // let file_string = { // let mut map: AnyMap = Default::default(); // map.insert(1, State { a: 42 }); -// serde_json::to_string(&map).unwrap() +// ron::to_string(&map).unwrap() // }; -// let mut map: AnyMap = serde_json::from_str(&file_string).unwrap(); +// let mut map: AnyMap = ron::from_str(&file_string).unwrap(); // assert_eq!( // map.get::(&1), // Some(&StateNew { diff --git a/egui/src/any/serializable/type_map.rs b/egui/src/any/serializable/type_map.rs index 124d97279..b3223849a 100644 --- a/egui/src/any/serializable/type_map.rs +++ b/egui/src/any/serializable/type_map.rs @@ -90,10 +90,10 @@ fn discard_different_struct() { let file_string = { let mut map: TypeMap = Default::default(); map.insert(State1 { a: 42 }); - serde_json::to_string(&map).unwrap() + ron::to_string(&map).unwrap() }; - let mut map: TypeMap = serde_json::from_str(&file_string).unwrap(); + let mut map: TypeMap = ron::from_str(&file_string).unwrap(); assert!(map.get::().is_none()); } @@ -115,10 +115,10 @@ fn new_field_between_runs() { let file_string = { let mut map: TypeMap = Default::default(); map.insert(State { a: 42 }); - serde_json::to_string(&map).unwrap() + ron::to_string(&map).unwrap() }; - let mut map: TypeMap = serde_json::from_str(&file_string).unwrap(); + let mut map: TypeMap = ron::from_str(&file_string).unwrap(); assert!(map.get::().is_none()); }