Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lang/rust/avro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ strum = "0.24.0"
strum_macros = "0.24.0"
thiserror = "1.0.30"
typed-builder = "0.10.0"
uuid = { version = "0.8.2", features = ["serde", "v4"] }
uuid = { version = "1.0.0", features = ["serde", "v4"] }
zerocopy = "0.6.1"
lazy_static = "1.4.0"
log = "0.4.16"
Expand Down
8 changes: 7 additions & 1 deletion lang/rust/avro/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ pub(crate) fn encode_internal(
let slice: [u8; 12] = duration.into();
buffer.extend_from_slice(&slice);
}
Value::Uuid(uuid) => encode_bytes(&uuid.to_string(), buffer),
Value::Uuid(uuid) => encode_bytes(
#[allow(unknown_lints)] // for Rust 1.51.0
#[allow(clippy::unnecessary_to_owned)]
// we need the call .to_string() to properly convert ASCII to UTF-8
&uuid.to_string(),
buffer,
),
Value::Bytes(bytes) => match *schema {
Schema::Bytes => encode_bytes(bytes, buffer),
Schema::Fixed { .. } => buffer.extend(bytes),
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
//! `apache-avro` also supports the logical types listed in the [Avro specification](https://avro.apache.org/docs/current/spec.html#Logical+Types):
//!
//! 1. `Decimal` using the [`num_bigint`](https://docs.rs/num-bigint/0.2.6/num_bigint) crate
//! 1. UUID using the [`uuid`](https://docs.rs/uuid/0.8.1/uuid) crate
//! 1. UUID using the [`uuid`](https://docs.rs/uuid/1.0.0/uuid) crate
//! 1. Date, Time (milli) as `i32` and Time (micro) as `i64`
//! 1. Timestamp (milli and micro) as `i64`
//! 1. Duration as a custom type with `months`, `days` and `millis` accessor methods each of which returns an `i32`
Expand Down
2 changes: 1 addition & 1 deletion lang/rust/avro/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ impl std::convert::TryFrom<Value> for JsonValue {
Value::Duration(d) => Ok(Self::Array(
<[u8; 12]>::from(d).iter().map(|&v| v.into()).collect(),
)),
Value::Uuid(uuid) => Ok(Self::String(uuid.to_hyphenated().to_string())),
Value::Uuid(uuid) => Ok(Self::String(uuid.as_hyphenated().to_string())),
}
}
}
Expand Down