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

fix: Remove dead code detected by the rust beta compiler #2121

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Mar 25, 2024

Description

The beta compiler identifies these as dead code.

Notes & open questions

Change checklist

  • Self-review.

The beta compiler identifies these as dead code.
// /// Returns true if `other` is a prefix of `self`.
// fn is_prefixed_by(&self, other: &Self) -> bool {
// other.is_prefix_of(self)
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Frando What is the deal with this trait?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, it's used in tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Frando I think I've made this happy for the compiler. But could you make sure it does the right thing?

@flub flub changed the title Remove a bunch of dead code fix: Remove dead code detected by the rust beta compiler Mar 25, 2024
@flub flub requested a review from Frando March 25, 2024 10:16
Copy link
Member

@Frando Frando left a comment

Choose a reason for hiding this comment

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

The changes in iroh-sync are 👍 - might very well be that these are only used in tests, because outside of tests we never work with the ranger keys and values in a generic way.

@flub
Copy link
Contributor Author

flub commented Mar 25, 2024

@Frando could you, err, approve in that case?

@@ -216,43 +216,6 @@ impl<W: BaoBatchWriter, F: Fn(u64, usize) -> io::Result<()> + 'static> BaoBatchW
}
}

/// A combined batch writer
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this is dead since we have a proper batch writer. In some branch I removed this already.

@Frando Frando self-requested a review March 25, 2024 12:25
@flub flub added this pull request to the merge queue Mar 25, 2024
Merged via the queue into main with commit 2c59d7d Mar 25, 2024
21 checks passed
@flub flub deleted the flub/beta-rust-fixes branch March 25, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants