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

Refactor fmt::Display impls in rustdoc #2

Closed
wants to merge 4 commits into from

Conversation

yotamofek
Copy link
Owner

@yotamofek yotamofek commented Jan 13, 2025

This PR does a couple of things, with the intention of cleaning up and streamlining some of the fmt::Display impls in rustdoc:

  1. Use the unstable fmt::from_fn instead of open-coding it.
  2. Replace bespoke implementations of Itertools::format with the method itself.
  3. Some more minor cleanups - DRY, remove unnecessary calls to Symbol::as_str(), replace some format!() calls with lazier options

The changes are mostly cosmetic but some of them might have a slight positive effect on performance.

@yotamofek yotamofek force-pushed the rustdoc-fmt-from_fn branch 3 times, most recently from d609093 to 88ec372 Compare January 14, 2025 13:03
@yotamofek yotamofek force-pushed the rustdoc-fmt-from_fn branch from 88ec372 to 16e9fe6 Compare January 14, 2025 17:11
@yotamofek yotamofek changed the title Rustdoc fmt from fn Refactor fmt::Display impls in rustdoc Jan 14, 2025
@yotamofek yotamofek closed this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant