Skip to content

Comments

Use collect_str for FunctionSelector serialization#3622

Merged
onbjerg merged 1 commit intoalloy-rs:mainfrom
Perekup1:patch-1
Jan 31, 2026
Merged

Use collect_str for FunctionSelector serialization#3622
onbjerg merged 1 commit intoalloy-rs:mainfrom
Perekup1:patch-1

Conversation

@Perekup1
Copy link
Contributor

Goal: Remove redundant String allocation in FunctionSelector serialization.
Change: Replace serialize_str(self.to_string().as_str()) with serializer.collect_str(self).
Why: FunctionSelector already implements Display; collect_str serializes via Display without the extra String/&str chain.

@onbjerg onbjerg merged commit 89ecb61 into alloy-rs:main Jan 31, 2026
30 checks passed
@github-project-automation github-project-automation bot moved this to Done in Alloy Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants