Skip to content

script: Let Console::internal_warn take String instead of DOMString#43780

Merged
mukilan merged 2 commits into
servo:mainfrom
TG199:clear_console_internal_warn_usage
Mar 31, 2026
Merged

script: Let Console::internal_warn take String instead of DOMString#43780
mukilan merged 2 commits into
servo:mainfrom
TG199:clear_console_internal_warn_usage

Conversation

@TG199

@TG199 TG199 commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

All callers were constructing a DOMString only to have it immediately converted back to String inside internal_warn, resulting in an unnecessary allocation and clone. This changes the parameter type to String and updates all call sites to pass the result of format! or .to_string() directly.

Fixes: #43091

TG199 added 2 commits March 30, 2026 23:53
Signed-off-by: Kelechi Ebiri <ebiritg@gmail.com>
Signed-off-by: Kelechi Ebiri <ebiritg@gmail.com>
@TG199 TG199 requested a review from gterzian as a code owner March 30, 2026 23:11
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 30, 2026
@TG199 TG199 changed the title Clear console internal warn usage script: Clear console internal warn usage Mar 30, 2026
@mukilan mukilan changed the title script: Clear console internal warn usage script: Let Console::internal_warn take String instead of DOMString Mar 31, 2026

@mukilan mukilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 31, 2026
@mukilan mukilan added this pull request to the merge queue Mar 31, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 31, 2026
Merged via the queue into servo:main with commit bb66773 Mar 31, 2026
36 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 31, 2026
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.

Clear up Console::internal_warn usages

3 participants