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

remove useless allocations #37

Merged
merged 2 commits into from
May 12, 2024

Conversation

jamesbt365
Copy link
Member

@jamesbt365 jamesbt365 commented May 11, 2024

Adds nicer interaction handling for pagination, removes generics on pagination Context usage.

Uses ArrayString for component custom ids because we know the size they are going to be, allowing us to avoid a heap allocation.

switches foo.push_str(&format!("{}\n", bar)); with writeln!(foo, "{bar}") avoiding an allocation for the usage of format!.

The format! macro calls write! internally and skipping the middle man here lets us avoid an allocation of a string just to deref it after.

@InfinityGhost InfinityGhost added the enhancement New feature or request label May 12, 2024
@InfinityGhost InfinityGhost merged commit e218a01 into OpenTabletDriver:master May 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants