Skip to content

Commit

Permalink
Depend on serde_derive explicitly
Browse files Browse the repository at this point in the history
Suggested-at: serde-rs/serde#2590

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Aug 22, 2023
1 parent 0f364e3 commit dccdaeb
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 24 deletions.
11 changes: 7 additions & 4 deletions lang/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lang/rust/avro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ pub fn from_value<'de, D: Deserialize<'de>>(value: &'de Value) -> Result<D, Erro
#[cfg(test)]
mod tests {
use pretty_assertions::assert_eq;
use serde::Serialize;
use serde_derive::Serialize;
use std::sync::atomic::Ordering;
use uuid::Uuid;

Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ mod tests {
use crate::{encode::encode, from_value, types::Record, Reader};
use apache_avro_test_helper::TestResult;
use pretty_assertions::assert_eq;
use serde::Deserialize;
use serde_derive::Deserialize;
use std::io::Cursor;

const SCHEMA: &str = r#"
Expand Down
13 changes: 5 additions & 8 deletions lang/rust/avro/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,7 @@ mod tests {
use super::*;
use apache_avro_test_helper::TestResult;
use pretty_assertions::assert_eq;
use serde_derive::{Deserialize, Serialize};
use serde_json::json;

#[test]
Expand Down Expand Up @@ -4659,17 +4660,15 @@ mod tests {
}
"#;

#[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,
#[serde(rename = "bar1")]
Bar1,
}

#[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,
Expand Down Expand Up @@ -4697,9 +4696,7 @@ mod tests {

#[test]
fn avro_3755_deserialize() -> 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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions lang/rust/avro/tests/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion lang/rust/avro_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 1 addition & 1 deletion lang/rust/fuzz/fuzz_targets/roundtrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion lang/rust/wasm-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/wasm-demo/tests/demos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit dccdaeb

Please sign in to comment.