Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel committed Sep 26, 2024
1 parent 315bd92 commit 8428653
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions arrow-schema/src/datatype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ pub trait ExtensionType: Sized {

/// Returns the serialized representation of the metadata of this extension
/// type, or `None` if this extension type has no metadata.
fn into_serialized_metadata(&self) -> Option<String>;
fn serialized_metadata(&self) -> Option<String>;

/// Deserialize this extension type from the serialized representation of the
/// metadata of this extension. An extension type that has no metadata should
Expand Down Expand Up @@ -842,7 +842,7 @@ impl<T> ExtensionTypeExt for T where T: ExtensionType {}
/// the definitions of well-known extension types so as to improve
/// interoperability between different systems integrating Arrow columnar data.
pub mod canonical_extension_types {
use serde_json::{Map, Value};
use serde_json::Value;

use super::{DataType, ExtensionType};

Expand Down Expand Up @@ -905,7 +905,7 @@ pub mod canonical_extension_types {
Some(&self.0)
}

fn into_serialized_metadata(&self) -> Option<String> {
fn serialized_metadata(&self) -> Option<String> {
Some(self.0.to_string())
}

Expand All @@ -917,7 +917,7 @@ pub mod canonical_extension_types {
value => value
.parse::<Value>()
.ok()
.filter(|value| value.as_object().is_some_and(Map::is_empty))
.filter(|value| matches!(value.as_object(), Some(map) if map.is_empty()))
.map(Self),
})
}
Expand Down Expand Up @@ -952,7 +952,7 @@ pub mod canonical_extension_types {
None
}

fn into_serialized_metadata(&self) -> Option<String> {
fn serialized_metadata(&self) -> Option<String> {
None
}

Expand Down
2 changes: 1 addition & 1 deletion arrow-schema/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl Field {
self.metadata
.insert(EXTENSION_TYPE_NAME_KEY.to_owned(), E::NAME.to_owned());
// Insert the metadata, if any
if let Some(metadata) = extension_type.into_serialized_metadata() {
if let Some(metadata) = extension_type.serialized_metadata() {
self.metadata
.insert(EXTENSION_TYPE_METADATA_KEY.to_owned(), metadata);
}
Expand Down

0 comments on commit 8428653

Please sign in to comment.