mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-16 09:11:55 +00:00
0656409904
I'm going to add string.len() method which will return a length in bytes. The number of the UTF-8 code points is useless metrics, and strings here are often ASCII bytes, so let's simply use byte indices in substr(). If the given index is not at a char boundary, it will be rounded. I considered making it an error, but that would be annoying. I would want to see something printed by author.name().substr() even if it contained latin characters. I've extracted index normalization function which might be used by other string methods. The remaining part of substr() is trivial, so inlined it. |
||
---|---|---|
.. | ||
examples | ||
src | ||
testing | ||
tests | ||
build.rs | ||
Cargo.toml | ||
LICENSE |