From dccdaebba550dc33cad1609250d667f75675a1f4 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Mon, 21 Aug 2023 10:38:59 +0300 Subject: [PATCH] Depend on serde_derive explicitly Suggested-at: https://github.com/serde-rs/serde/pull/2590 Signed-off-by: Martin Tzvetanov Grigorov --- lang/rust/Cargo.lock | 11 +++++++---- lang/rust/avro/Cargo.toml | 3 ++- lang/rust/avro/README.md | 2 +- lang/rust/avro/src/de.rs | 2 +- lang/rust/avro/src/reader.rs | 2 +- lang/rust/avro/src/schema.rs | 13 +++++-------- lang/rust/avro/src/ser.rs | 2 +- lang/rust/avro/src/writer.rs | 2 +- lang/rust/avro/tests/schema.rs | 4 ++-- lang/rust/avro_derive/Cargo.toml | 3 ++- lang/rust/fuzz/fuzz_targets/roundtrip.rs | 2 +- lang/rust/wasm-demo/Cargo.toml | 3 ++- lang/rust/wasm-demo/tests/demos.rs | 2 +- 13 files changed, 27 insertions(+), 24 deletions(-) diff --git a/lang/rust/Cargo.lock b/lang/rust/Cargo.lock index fbb4fb941e8..1d24f8dacfa 100644 --- a/lang/rust/Cargo.lock +++ b/lang/rust/Cargo.lock @@ -83,6 +83,7 @@ dependencies = [ "rand", "regex-lite", "serde", + "serde_derive", "serde_json", "sha2", "snap", @@ -105,6 +106,7 @@ dependencies = [ "proptest", "quote", "serde", + "serde_derive", "serde_json", "syn", ] @@ -536,6 +538,7 @@ dependencies = [ "apache-avro", "console_error_panic_hook", "serde", + "serde_derive", "wasm-bindgen", "wasm-bindgen-test", ] @@ -955,18 +958,18 @@ checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" dependencies = [ "proc-macro2", "quote", diff --git a/lang/rust/avro/Cargo.toml b/lang/rust/avro/Cargo.toml index 872753dbf9b..59b6398594a 100644 --- a/lang/rust/avro/Cargo.toml +++ b/lang/rust/avro/Cargo.toml @@ -63,7 +63,8 @@ libflate = { default-features = false, version = "2.0.0", features = ["std"] } log = { default-features = false, version = "0.4.20" } num-bigint = { default-features = false, version = "0.4.3" } regex-lite = { default-features = false, version = "0.1.0", features = ["std", "string"] } -serde = { default-features = false, version = "1.0.183", features = ["derive"] } +serde = { default-features = false, version = "1.0.185" } +serde_derive = { default-features = false, version = "1.0.185" } serde_json = { default-features = false, version = "1.0.105", features = ["std"] } snap = { default-features = false, version = "1.1.0", optional = true } strum = { default-features = false, version = "0.25.0" } diff --git a/lang/rust/avro/README.md b/lang/rust/avro/README.md index beddf0f8422..598f35498cf 100644 --- a/lang/rust/avro/README.md +++ b/lang/rust/avro/README.md @@ -382,7 +382,7 @@ quick reference of the library interface: ```rust use apache_avro::{Codec, Reader, Schema, Writer, from_value, types::Record, Error}; -use serde::{Deserialize, Serialize}; +use serde_derive::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] struct Test { diff --git a/lang/rust/avro/src/de.rs b/lang/rust/avro/src/de.rs index 610b15ae597..a0f65afd76f 100644 --- a/lang/rust/avro/src/de.rs +++ b/lang/rust/avro/src/de.rs @@ -651,7 +651,7 @@ pub fn from_value<'de, D: Deserialize<'de>>(value: &'de Value) -> Result TestResult { - #[derive( - Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Clone, serde::Deserialize, serde::Serialize, - )] + #[derive(Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Clone, Deserialize, Serialize)] pub enum Bar { #[serde(rename = "bar0")] Bar0, @@ -4709,7 +4706,7 @@ mod tests { Bar2, } - #[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)] + #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] pub struct Foo { #[serde(rename = "barInit")] pub bar_init: Bar, diff --git a/lang/rust/avro/src/ser.rs b/lang/rust/avro/src/ser.rs index f79e0586682..31af0dcf638 100644 --- a/lang/rust/avro/src/ser.rs +++ b/lang/rust/avro/src/ser.rs @@ -491,7 +491,7 @@ mod tests { use super::*; use apache_avro_test_helper::TestResult; use pretty_assertions::assert_eq; - use serde::{Deserialize, Serialize}; + use serde_derive::{Deserialize, Serialize}; use std::sync::atomic::Ordering; #[derive(Debug, Deserialize, Serialize, Clone)] diff --git a/lang/rust/avro/src/writer.rs b/lang/rust/avro/src/writer.rs index 83e863455f2..799f59ed29c 100644 --- a/lang/rust/avro/src/writer.rs +++ b/lang/rust/avro/src/writer.rs @@ -637,7 +637,7 @@ mod tests { util::zig_i64, }; use pretty_assertions::assert_eq; - use serde::{Deserialize, Serialize}; + use serde_derive::{Deserialize, Serialize}; use apache_avro_test_helper::TestResult; diff --git a/lang/rust/avro/tests/schema.rs b/lang/rust/avro/tests/schema.rs index 22330587601..38cfae9476c 100644 --- a/lang/rust/avro/tests/schema.rs +++ b/lang/rust/avro/tests/schema.rs @@ -1451,7 +1451,7 @@ fn avro_old_issue_47() -> TestResult { }"#; let schema = Schema::parse_str(schema_str)?; - use serde::{Deserialize, Serialize}; + use serde_derive::{Deserialize, Serialize}; #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)] pub struct MyRecord { @@ -1478,7 +1478,7 @@ fn avro_old_issue_47() -> TestResult { fn test_avro_3785_deserialize_namespace_with_nullable_type_containing_reference_type() -> TestResult { use apache_avro::{from_avro_datum, to_avro_datum, types::Value}; - use serde::{Deserialize, Serialize}; + use serde_derive::{Deserialize, Serialize}; #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] pub struct BarUseParent { diff --git a/lang/rust/avro_derive/Cargo.toml b/lang/rust/avro_derive/Cargo.toml index 7065927cd83..7cf82bbadee 100644 --- a/lang/rust/avro_derive/Cargo.toml +++ b/lang/rust/avro_derive/Cargo.toml @@ -42,4 +42,5 @@ syn = { default-features = false, version = "2.0.29", features = ["full", "fold" [dev-dependencies] apache-avro = { default-features = false, path = "../avro", features = ["derive"] } proptest = { default-features = false, version = "1.2.0", features = ["std"] } -serde = { default-features = false, version = "1.0.183", features = ["derive"] } +serde = { default-features = false, version = "1.0.185" } +serde_derive = { default-features = false, version = "1.0.185" } diff --git a/lang/rust/fuzz/fuzz_targets/roundtrip.rs b/lang/rust/fuzz/fuzz_targets/roundtrip.rs index 14bc59c8c2e..d45fc6d2095 100644 --- a/lang/rust/fuzz/fuzz_targets/roundtrip.rs +++ b/lang/rust/fuzz/fuzz_targets/roundtrip.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use serde::{Deserialize, Serialize}; +use serde_derive::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, PartialEq)] enum PlainEnum { diff --git a/lang/rust/wasm-demo/Cargo.toml b/lang/rust/wasm-demo/Cargo.toml index 62ac5ee237e..bce45c1a783 100644 --- a/lang/rust/wasm-demo/Cargo.toml +++ b/lang/rust/wasm-demo/Cargo.toml @@ -36,7 +36,8 @@ crate-type = ["cdylib", "rlib"] [dependencies] apache-avro = { path = "../avro" } -serde = { default-features = false, version = "1.0.183", features = ["derive"] } +serde = { default-features = false, version = "1.0.185" } +serde_derive = { default-features = false, version = "1.0.185" } wasm-bindgen = "0.2.87" [dev-dependencies] diff --git a/lang/rust/wasm-demo/tests/demos.rs b/lang/rust/wasm-demo/tests/demos.rs index 89be21f7266..5fff4f1c223 100644 --- a/lang/rust/wasm-demo/tests/demos.rs +++ b/lang/rust/wasm-demo/tests/demos.rs @@ -23,7 +23,7 @@ use std::io::BufWriter; use wasm_bindgen_test::*; use apache_avro::{from_value, to_value, types::Record, Codec, Reader, Schema, Writer}; -use serde::{Deserialize, Serialize}; +use serde_derive::{Deserialize, Serialize}; wasm_bindgen_test_configure!(run_in_browser);