Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uses of #[allow(dead_code)] in favor of _identifier #13328

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ding-young
Copy link

Which issue does this PR close?

Closes #13278.

What changes are included in this PR?

This PR refactors instances where #[allow(dead_code)] was used on struct fields that exist solely to ensure their Drop (destructor) is called. In such cases, the field name has been updated to use an underscore prefix (e.g., _name) instead of relying on #[allow(dead_code)]. This change aligns with idiomatic Rust practices, where _ prefixes indicate that fields or variables are intentionally unused but still necessary (e.g., memory reservation, tmp file cleanup in the source code).

Are these changes tested?

Yes, in local environment.

@github-actions github-actions bot added physical-expr Physical Expressions core Core DataFusion crate execution Related to the execution crate labels Nov 9, 2024
@jatin510
Copy link
Contributor

jatin510 commented Nov 9, 2024

lgtm

@@ -230,8 +230,7 @@ async fn main() -> Result<()> {
#[derive(Debug)]
pub struct IndexTableProvider {
/// Where the file is stored (cleanup on drop)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Where the file is stored (cleanup on drop)
/// Pointer to temporary file storage. Keeping it in scope to prevent temporary folder to be deleted prematurely

@@ -362,8 +362,7 @@ impl TestFull {
// Holds necessary data for these tests to reuse the same parquet file
struct TestData {
// field is present as on drop the file is deleted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// field is present as on drop the file is deleted
/// Pointer to temporary file storage. Keeping it in scope to prevent temporary folder to be deleted prematurely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate execution Related to the execution crate physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove uses of #[allow(dead_code) in favor of names starting with _
4 participants