Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
enhance fmt and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
xudong963 committed Oct 10, 2021
1 parent 25ddb0d commit 3583f6b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install clippy
run: rustup component add clippy
- name: "clippy --all"
run: cargo clippy --all --tests
run: cargo clippy --all --tests -- -D warnings

fmt:
name: fmt
Expand All @@ -64,8 +64,8 @@ jobs:
- uses: Swatinem/rust-cache@v1
- name: Install rustfmt
run: rustup component add rustfmt

- run: cargo fmt
- name: Run
run: cargo fmt --all -- --check

miri-checks:
name: Miri
Expand Down
17 changes: 0 additions & 17 deletions src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,6 @@ macro_rules! fmt_dyn {
}};
}

macro_rules! with_match_dictionary_key_type {(
$key_type:expr, | $_:tt $T:ident | $($body:tt)*
) => ({
macro_rules! __with_ty__ {( $_ $T:ident ) => ( $($body)* )}
match $key_type {
DataType::Int8 => __with_ty__! { i8 },
DataType::Int16 => __with_ty__! { i16 },
DataType::Int32 => __with_ty__! { i32 },
DataType::Int64 => __with_ty__! { i64 },
DataType::UInt8 => __with_ty__! { u8 },
DataType::UInt16 => __with_ty__! { u16 },
DataType::UInt32 => __with_ty__! { u32 },
DataType::UInt64 => __with_ty__! { u64 },
_ => ::core::unreachable!("A dictionary key type can only be of integer types"),
}
})}

macro_rules! with_match_physical_dictionary_key_type {(
$key_type:expr, | $_:tt $T:ident | $($body:tt)*
) => ({
Expand Down
13 changes: 0 additions & 13 deletions src/datatypes/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,3 @@ impl std::fmt::Display for Field {

pub(crate) type Metadata = Option<BTreeMap<String, String>>;
pub(crate) type Extension = Option<(String, Option<String>)>;

pub(crate) fn get_extension(metadata: &Option<BTreeMap<String, String>>) -> Extension {
if let Some(metadata) = metadata {
if let Some(name) = metadata.get("ARROW:extension:name") {
let metadata = metadata.get("ARROW:extension:metadata").cloned();
Some((name.clone(), metadata))
} else {
None
}
} else {
None
}
}
2 changes: 1 addition & 1 deletion src/datatypes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub use field::Field;
pub use physical_type::*;
pub use schema::Schema;

pub(crate) use field::{get_extension, Extension, Metadata};
pub(crate) use field::{Extension, Metadata};

/// The set of supported logical types.
/// Each variant uniquely identifies a logical type, which define specific semantics to the data (e.g. how it should be represented).
Expand Down

0 comments on commit 3583f6b

Please sign in to comment.