diff --git a/crates/deltalake-core/Cargo.toml b/crates/deltalake-core/Cargo.toml index ce1c7490ad..a670456363 100644 --- a/crates/deltalake-core/Cargo.toml +++ b/crates/deltalake-core/Cargo.toml @@ -130,6 +130,7 @@ tempfile = "3" tokio = { version = "1", features = ["macros", "rt-multi-thread"] } utime = "0.3" hyper = { version = "0.14", features = ["server"] } +criterion = "0.5" [features] azure = ["object_store/azure"] diff --git a/crates/deltalake-core/benches/read_checkpoint.rs b/crates/deltalake-core/benches/read_checkpoint.rs index 2ecbee661b..0db72c3e17 100644 --- a/crates/deltalake-core/benches/read_checkpoint.rs +++ b/crates/deltalake-core/benches/read_checkpoint.rs @@ -1,6 +1,6 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use deltalake::table::state::DeltaTableState; -use deltalake::DeltaTableConfig; +use deltalake_core::table::state::DeltaTableState; +use deltalake_core::DeltaTableConfig; use std::fs::File; use std::io::Read; diff --git a/crates/deltalake-core/src/operations/transaction/protocol.rs b/crates/deltalake-core/src/operations/transaction/protocol.rs index 23dd3c2e52..8bceba74ce 100644 --- a/crates/deltalake-core/src/operations/transaction/protocol.rs +++ b/crates/deltalake-core/src/operations/transaction/protocol.rs @@ -78,14 +78,11 @@ impl ProtocolChecker { .difference(&self.reader_features) .cloned() .collect(); - if diff.is_empty() { - Ok(()) - } else { - Err(TransactionError::UnsupportedReaderFeatures(diff)) + if !diff.is_empty() { + return Err(TransactionError::UnsupportedReaderFeatures(diff)); } - } else { - return Ok(()); - } + }; + Ok(()) } /// Check if delta-rs can write to the given delta table. @@ -108,15 +105,11 @@ impl ProtocolChecker { .difference(&self.writer_features) .cloned() .collect(); - if diff.is_empty() { - Ok(()) - } else { - Err(TransactionError::UnsupportedWriterFeatures(diff)) + if !diff.is_empty() { + return Err(TransactionError::UnsupportedWriterFeatures(diff)); } - } else { - // TODO: check if this is correct - Ok(()) - } + }; + Ok(()) } }