compact_str
compact_str copied to clipboard
Some slightly performance & style updates
- In the function
fn as_bytes
inimpl CompactString
, there is an redundant slicing (with aself.len()
call) which is unnecessary after the update c95edd5. - This crate has documented that for 64-bit architectures the capacity will be always inlined. So the logic of
is_heap
can be replaced with directly returningfalse
to reduce some code generation.