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: replace format! with other macros/methods when unnecessary #176

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

Integral-Tech
Copy link
Contributor

Description

  • Replace format! macro with other macros/methods (such as concat!) when it is unnecessary

Motivation and Context

  • format! macro introduces overhead of creating a new String object during runtime. When concat!, push() or push_str() is sufficient, use them instead of format!.

How Has This Been Tested?

Screenshots / Output (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation and changelog accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Rustfmt and Rust-clippy passed.

@Integral-Tech Integral-Tech requested a review from orhun as a code owner December 2, 2024 05:39
@orhun
Copy link
Owner

orhun commented Dec 2, 2024

Thanks!

@orhun orhun merged commit 4206db3 into orhun:master Dec 2, 2024
3 of 5 checks passed
@Integral-Tech Integral-Tech deleted the replace-format branch December 2, 2024 10:06
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.

2 participants