Skip to content

Commit 0825eba

Browse files
committed
chore: Checks
1 parent 20bb111 commit 0825eba

4 files changed

Lines changed: 14 additions & 22 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/catalog/hadoop/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,13 @@ license = { workspace = true }
2929
repository = { workspace = true }
3030

3131
[dependencies]
32-
anyhow = { workspace = true }
3332
async-trait = { workspace = true }
3433
futures = { workspace = true }
3534
iceberg = { workspace = true }
3635
opendal = { workspace = true }
3736
serde_json = { workspace = true }
3837
tokio = { workspace = true }
3938
tracing = { workspace = true }
40-
typed-builder = { workspace = true }
41-
uuid = { workspace = true }
4239

4340
[dev-dependencies]
4441
arrow = { version = "55", features = ["prettyprint"] }

crates/catalog/hadoop/src/catalog.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ impl HadoopCatalogBuilder {
101101
));
102102
}
103103

104-
if !warehouse_root.ends_with("/") {
105-
warehouse_root.push_str("/");
104+
if !warehouse_root.ends_with('/') {
105+
warehouse_root.push('/');
106106
}
107107

108108
Ok(HadoopCatalog {
@@ -250,7 +250,7 @@ impl Catalog for HadoopCatalog {
250250
async fn load_table(&self, table_identifier: &TableIdent) -> Result<Table> {
251251
if !self.table_exists(table_identifier).await? {
252252
if let MetadataMode::Exact(ref metadata_file) = self.metadata_mode {
253-
let input_file = self.file_io.new_input(&metadata_file)?;
253+
let input_file = self.file_io.new_input(metadata_file)?;
254254
if !input_file.exists().await? {
255255
return Err(Error::new(
256256
ErrorKind::DataInvalid,
@@ -459,7 +459,7 @@ impl HadoopCatalog {
459459
let input_data = self.file_io.new_input(&data_dir)?;
460460
return Ok(input_data.exists().await?
461461
&& matches!(input_data.metadata().await?.mode, EntryMode::DIR)
462-
&& self.directory_has_metadata(&path, metadata_mode).await?);
462+
&& self.directory_has_metadata(path, metadata_mode).await?);
463463
}
464464

465465
async fn directory_exists(&self, path: &str) -> Result<bool> {

crates/catalog/hadoop/tests/hadoop_catalog_test.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ async fn get_hadoop_catalog() -> HadoopCatalog {
2828
let cargo_manifest_dir = env!("CARGO_MANIFEST_DIR");
2929
let test_data_path = format!("file://{}/testdata/hadoop_warehouse", cargo_manifest_dir);
3030
// let catalog = HadoopCatalog::new(test_data_path, file_io);
31-
let catalog = HadoopCatalogBuilder::default()
31+
HadoopCatalogBuilder::default()
3232
.with_file_io(file_io)
3333
.with_warehouse_root(test_data_path)
3434
.build()
3535
.await
36-
.expect("Should build HadoopCatalog");
37-
38-
catalog
36+
.expect("Should build HadoopCatalog")
3937
}
4038

4139
mod tests {
@@ -76,7 +74,7 @@ mod tests {
7674
// List tables in the nested namespace
7775
let mut tables = catalog
7876
.list_tables(
79-
&iceberg::NamespaceIdent::from_strs(&["nested", "test"])
77+
&iceberg::NamespaceIdent::from_strs(["nested", "test"])
8078
.expect("Should create namespace"),
8179
)
8280
.await
@@ -112,18 +110,18 @@ mod tests {
112110
namespaces
113111
);
114112

115-
namespaces.sort_by(|a, b| a.to_string().cmp(&b.to_string()));
113+
namespaces.sort_by_key(|ns| ns.to_string());
116114

117115
assert!(
118116
namespaces[0].to_string() == "nested",
119117
"The namespace should be 'nested', found: {}",
120-
namespaces[0].to_string()
118+
namespaces[0]
121119
);
122120

123121
assert!(
124122
namespaces[1].to_string() == "test",
125123
"The namespace should be 'test', found: {}",
126-
namespaces[1].to_string()
124+
namespaces[1]
127125
);
128126

129127
// List namespaces in the nested namespace
@@ -141,7 +139,7 @@ mod tests {
141139
assert!(
142140
nested_namespaces[0].to_string() == "nested.test",
143141
"The nested namespace should be 'nested.test', found: {}",
144-
nested_namespaces[0].to_string()
142+
nested_namespaces[0]
145143
);
146144
}
147145

@@ -171,7 +169,7 @@ mod tests {
171169
// Check a nested namespace
172170
let nested_exists = catalog
173171
.namespace_exists(
174-
&iceberg::NamespaceIdent::from_strs(&["nested", "test"])
172+
&iceberg::NamespaceIdent::from_strs(["nested", "test"])
175173
.expect("Should create nested namespace"),
176174
)
177175
.await
@@ -198,7 +196,7 @@ mod tests {
198196
// Check if a nested table exists
199197
let exists = catalog
200198
.table_exists(&iceberg::TableIdent::new(
201-
iceberg::NamespaceIdent::from_strs(&["nested", "test"])
199+
iceberg::NamespaceIdent::from_strs(["nested", "test"])
202200
.expect("Should create nested namespace"),
203201
"my_table_3".to_string(),
204202
))
@@ -328,7 +326,7 @@ mod tests {
328326
{
329327
let table = catalog
330328
.load_table(&iceberg::TableIdent::new(
331-
iceberg::NamespaceIdent::from_strs(&["nested", "test"])
329+
iceberg::NamespaceIdent::from_strs(["nested", "test"])
332330
.expect("Should create nested namespace"),
333331
"my_table_3".to_string(),
334332
))

0 commit comments

Comments
 (0)