-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
refactor: replace iter_join
with itertools::join
#13275
Conversation
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
@@ -228,7 +228,7 @@ impl OnDiskReports { | |||
/// Returns an ANSI-styled report | |||
pub fn get_report(&self, id: u32, package: Option<&str>) -> CargoResult<String> { | |||
let report = self.reports.iter().find(|r| r.id == id).ok_or_else(|| { | |||
let available = iter_join(self.reports.iter().map(|r| r.id.to_string()), ", "); | |||
let available = itertools::join(self.reports.iter().map(|r| r.id), ", "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you preferred the free method over the extension trait method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface is similar to iter_join
and can be benefit from IntoIterator
.
(not applicable to this case though).
@bors r+ |
☀️ Test successful - checks-actions |
Update cargo 14 commits in 2ce45605d9db521b5fd6c1211ce8de6055fdb24e..3e428a38a34e820a461d2cc082e726d3bda71bcb 2024-01-04 18:04:13 +0000 to 2024-01-09 20:46:36 +0000 - refactor: replace `iter_join` with `itertools::join` (rust-lang/cargo#13275) - docs(unstable): doc comments for items and fields (rust-lang/cargo#13274) - crates-io: Set `Content-Type: application/json` only for requests with a body payload (rust-lang/cargo#13264) - fix: only inherit workspace package table if the new package is a member (rust-lang/cargo#13261) - feat(cli): add colors to `-Zhelp` console output (rust-lang/cargo#13269) - chore(deps): update msrv (rust-lang/cargo#13266) - refactor(toml): Make it more obvious to update package-dependent fields (rust-lang/cargo#13267) - chore(ci): Fix MSRV:3 updates (rust-lang/cargo#13268) - chore(ci): Shot-in-the-dark fix for MSRV updating (rust-lang/cargo#13265) - fix: set OUT_DIR for all units with build scripts (rust-lang/cargo#13204) - fix(manifest): Provide unused key warnings for lints table (rust-lang/cargo#13262) - test(manifest): Verify we warn on unused workspace.package fields (rust-lang/cargo#13263) - docs(changelog): Call out cargo-new lockfile change (rust-lang/cargo#13260) - chore: Add dependency dashboard (rust-lang/cargo#13255) r? ghost
What does this PR try to resolve?
This removes ad-hoc functions
iter_join
anditer_join_onto
.How should we test and review this PR?
There is no functional change.
Additional information