-
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
Use context instead of with_context #14377
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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.
No objection to these changes. Thank you!
Inline variables in `format!` Co-authored-by: Weihang Lo <[email protected]>
@bors r+ Thanks! |
☀️ Test successful - checks-actions |
Update cargo 7 commits in 0d8d22f83b066503f6b2b755925197e959e58b4f..2f738d617c6ead388f899802dd1a7fd66858a691 2024-08-08 12:54:24 +0000 to 2024-08-13 10:57:52 +0000 - chore: downgrade to openssl v1.1.1 (again) (rust-lang/cargo#14391) - feat(trim-paths): rustdoc supports trim-paths for diagnostics (rust-lang/cargo#14389) - Use longhand gitoxide path-spec patterns (rust-lang/cargo#14380) - feat: Add `info` cargo subcommand (rust-lang/cargo#14141) - CI: Switch macos aarch64 to nightly (rust-lang/cargo#14382) - Use context instead of with_context (rust-lang/cargo#14377) - Fix: `cargo package` failed on bare commit git repo. (rust-lang/cargo#14359) r? ghost
Update cargo 7 commits in 0d8d22f83b066503f6b2b755925197e959e58b4f..2f738d617c6ead388f899802dd1a7fd66858a691 2024-08-08 12:54:24 +0000 to 2024-08-13 10:57:52 +0000 - chore: downgrade to openssl v1.1.1 (again) (rust-lang/cargo#14391) - feat(trim-paths): rustdoc supports trim-paths for diagnostics (rust-lang/cargo#14389) - Use longhand gitoxide path-spec patterns (rust-lang/cargo#14380) - feat: Add `info` cargo subcommand (rust-lang/cargo#14141) - CI: Switch macos aarch64 to nightly (rust-lang/cargo#14382) - Use context instead of with_context (rust-lang/cargo#14377) - Fix: `cargo package` failed on bare commit git repo. (rust-lang/cargo#14359) r? ghost
Update cargo 7 commits in 0d8d22f83b066503f6b2b755925197e959e58b4f..2f738d617c6ead388f899802dd1a7fd66858a691 2024-08-08 12:54:24 +0000 to 2024-08-13 10:57:52 +0000 - chore: downgrade to openssl v1.1.1 (again) (rust-lang/cargo#14391) - feat(trim-paths): rustdoc supports trim-paths for diagnostics (rust-lang/cargo#14389) - Use longhand gitoxide path-spec patterns (rust-lang/cargo#14380) - feat: Add `info` cargo subcommand (rust-lang/cargo#14141) - CI: Switch macos aarch64 to nightly (rust-lang/cargo#14382) - Use context instead of with_context (rust-lang/cargo#14377) - Fix: `cargo package` failed on bare commit git repo. (rust-lang/cargo#14359) r? ghost
Update cargo 7 commits in 0d8d22f83b066503f6b2b755925197e959e58b4f..2f738d617c6ead388f899802dd1a7fd66858a691 2024-08-08 12:54:24 +0000 to 2024-08-13 10:57:52 +0000 - chore: downgrade to openssl v1.1.1 (again) (rust-lang/cargo#14391) - feat(trim-paths): rustdoc supports trim-paths for diagnostics (rust-lang/cargo#14389) - Use longhand gitoxide path-spec patterns (rust-lang/cargo#14380) - feat: Add `info` cargo subcommand (rust-lang/cargo#14141) - CI: Switch macos aarch64 to nightly (rust-lang/cargo#14382) - Use context instead of with_context (rust-lang/cargo#14377) - Fix: `cargo package` failed on bare commit git repo. (rust-lang/cargo#14359) r? ghost
Replace
.with_context(|| "…")
with.context("…")
to avoid calling a trivial closure. It is also shorter :)On the other hand, use
.with_context(|| format!(…))
instead of.context(format!(…))
to avoid unneeded string allocation.