Closed ghost closed 7 years ago
Thanks !
This is wrong for more complicated pad chars.
It should be s.as_bytes().len() + (pad as usize) * padchar.len_utf8()
EDIT: And this misses a cmp::max in there. I'll create another PR...
EDIT2: Done. PR #6 supersedes this PR.
presizes the buffer to avoid re-allocations while padding.