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

Commit

Permalink
Simplified reading
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Dec 28, 2021
1 parent 45f2fa9 commit 78faa36
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/io/ipc/read/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ fn deserialize_field(ipc_field: ipc::Field) -> (Field, IpcField) {

fn read_metadata(field: &ipc::Field) -> Metadata {
if let Some(list) = field.custom_metadata() {
let mut metadata_map = BTreeMap::default();
for kv in list {
if let (Some(k), Some(v)) = (kv.key(), kv.value()) {
metadata_map.insert(k.to_string(), v.to_string());
if !list.is_empty() {
let mut metadata_map = BTreeMap::default();
for kv in list {
if let (Some(k), Some(v)) = (kv.key(), kv.value()) {
metadata_map.insert(k.to_string(), v.to_string());
}
}
Some(metadata_map)
} else {
None
}
Some(metadata_map)
} else {
None
}
Expand Down

0 comments on commit 78faa36

Please sign in to comment.