Skip to content

Conversation

@soniseth0
Copy link
Contributor

Removed redundant .to_string().as_str() patterns that create unnecessary temporary String allocations. The pattern .to_string().as_str() allocates a String only to immediately take a &str reference and drop it, which is wasteful.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

@orizi reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @soniseth0)

@orizi orizi enabled auto-merge November 20, 2025 09:17
pub fn compile_libfunc(libfunc: &str, refs: Vec<ReferenceExpression>) -> ReducedCompiledInvocation {
let long_id = cairo_lang_sierra::ConcreteLibfuncLongIdParser::new()
.parse(libfunc.to_string().as_str())
.parse(libfunc)
Copy link
Collaborator

Choose a reason for hiding this comment

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

run ./scripts/rust_fmt.sh

@soniseth0 soniseth0 closed this by deleting the head repository Nov 21, 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.

3 participants