apache / iceberg-rust

Apache Iceberg
https://rust.iceberg.apache.org/
Apache License 2.0
469 stars 95 forks source link

nit: Cleanup `#[allow(dead_code)]` from our codebase #413

Closed Xuanwo closed 3 days ago

Xuanwo commented 1 week ago

Most of our API should be complete now. Time to remove #[allow(dead_code)] from our codebase.

Dysprosium0626 commented 1 week ago

Maybe I can help with this? @Xuanwo

Xuanwo commented 1 week ago

Maybe I can help with this? @Xuanwo

Of course, have fun!

vivek378521 commented 4 days ago

Hello @Xuanwo

I have removed the #[allow(dead_code)] from the codebase, I have raised a PR

Warnings still exist though - should I remove those functions which are not used?

https://github.com/apache/iceberg-rust/pull/421

These are the warning functions warning: functionvisit` is never used --> crates/iceberg/src/avro/schema.rs:297:15 297 pub(crate) fn visit(schema: &AvroSchema, visitor: &mut V) -> Result { ^^^^^
= note: `#[warn(dead_code)]` on by default

warning: function avro_schema_to_schema is never used --> crates/iceberg/src/avro/schema.rs:500:15 | 500 | pub(crate) fn avro_schema_to_schema(avro_schema: &AvroSchema) -> Result { | ^^^^^^^^^^^^^^^^^^^^^

warning: field column_names is never read --> crates/iceberg/src/scan.rs:221:5 217 pub struct TableScan { --------- field in this struct ... 221 column_names: Vec, ^^^^^^^^^^^^
= note: `TableScan` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: field expression_evaluator is never read --> crates/iceberg/src/expr/visitors/expression_evaluator.rs:62:5 60 struct ExpressionEvaluatorVisitor<'a> { -------------------------- field in this struct 61 /// Reference to an [ExpressionEvaluator]. 62 expression_evaluator: &'a ExpressionEvaluator, ^^^^^^^^^^^^^^^^^^^^

= note: ExpressionEvaluatorVisitor has a derived impl for the trait Debug, but this is intentionally ignored during dead code analysis

warning: field manifest_evaluator is never read --> crates/iceberg/src/expr/visitors/manifest_evaluator.rs:56:5 | 55 | struct ManifestFilterVisitor<'a> { | --------------------- field in this struct 56 | manifest_evaluator: &'a ManifestEvaluator, | ^^^^^^^^^^^^^^^^^^

warning: iceberg (lib) generated 5 warnings`

Dysprosium0626 commented 3 days ago

@vivek378521 Thanks for helping!

liurenjie1024 commented 3 days ago

Close by #421