-
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
fix: remove unnecessary allocations #8641
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
wuld Iterator.eq work here? |
Updated. Thanks 😄 |
@bors r+ |
📌 Commit 0c70319 has been approved by |
☀️ Test successful - checks-actions |
Update cargo 8 commits in 51b66125ba97d2906f461b3f4e0408f206299bb6..126907a7cfccbe93778530e6a6bbaa3adb6c515c 2020-08-19 20:22:52 +0000 to 2020-08-31 20:42:11 +0000 - Fix flakiness in close_output test (rust-lang/cargo#8668) - Reload unstable table from config file in `reload_rooted_at` (rust-lang/cargo#8656) - Bump to 0.49.0, update changelog (rust-lang/cargo#8659) - Fix LTO with doctests. (rust-lang/cargo#8657) - Add spaces after -C and -Z flags for consistency (rust-lang/cargo#8648) - Fix cache_messages::rustdoc test broken on beta. (rust-lang/cargo#8653) - fix: remove unnecessary allocations (rust-lang/cargo#8641) - Fixed a spelling and some clippy warnings (rust-lang/cargo#8637)
Remove unnecessary
str::to_string
andstr::replace
allocations by using iterators. This PR is almost identical to #8622 except it does not skip the generated header.Sorry that I did not profile the changes by myself. Seems that valgrind does not support macOS 10.15.6, I have not idea how to profile cargo subcommand. It would be great for an instruction to run a memory profiling for Rust program on macOS.