Closed jamesbt365 closed 6 months ago
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!.
foo.push_str(&format!("{}\n", bar));
writeln!(foo, "{bar}")
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.
write!
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));
withwriteln!(foo, "{bar}")
avoiding an allocation for the usage offormat!
.The
format!
macro callswrite!
internally and skipping the middle man here lets us avoid an allocation of a string just to deref it after.