From 4130292706fa8e15ac1b5d9c85dfc5638f337900 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 13 Feb 2021 00:04:40 +0000 Subject: [PATCH] Upgrade to serde-json-core v0.2.0 This also fixes the network interface for writing IIR coefficients. --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/server.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17030d2..444756b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -915,9 +915,9 @@ dependencies = [ [[package]] name = "serde-json-core" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf406405ada9ef326ca78677324ac66994ff348fc48a16030be08caeed29825" +checksum = "89fd6016a00149b485f66da701f76d909210d319040c97b6eff300f6e2ba2153" dependencies = [ "heapless", "serde", diff --git a/Cargo.toml b/Cargo.toml index d5fc525..bb167cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ panic-semihosting = { version = "0.5", optional = true } panic-halt = "0.2" serde = { version = "1.0", features = ["derive"], default-features = false } heapless = { version = "0.5", features = ["serde"] } -serde-json-core = "0.1" +serde-json-core = "0.2" cortex-m-rtic = "0.5.5" embedded-hal = "0.2.4" nb = "1.0.0" diff --git a/src/server.rs b/src/server.rs index 5e6950d..cd9f5ac 100644 --- a/src/server.rs +++ b/src/server.rs @@ -40,7 +40,7 @@ macro_rules! route_request { $( $write_attribute => { let new_value = match serde_json_core::from_str::<$TYPE>(&$request.value) { - Ok(data) => data, + Ok((data, _)) => data, Err(_) => return server::Response::error($request.attribute, "Failed to decode value"), }; @@ -253,7 +253,7 @@ impl Server { &self.data[..self.data.len() - 1], ); match r { - Ok(mut res) => { + Ok((mut res, _)) => { // Note that serde_json_core doesn't escape quotations within a string. // To account for this, we manually translate all single quotes to // double quotes. This occurs because we doubly-serialize this field in