Allow [in] to be used on subarray types. Added more to "conv" module.

This commit is contained in:
Christoffer Lerno
2022-07-09 19:32:39 +02:00
parent 9fdd66af42
commit ca21b1daac
4 changed files with 435 additions and 143 deletions

View File

@@ -18,8 +18,8 @@ fn Char32! StringIterator.next(StringIterator* this)
usize len = this.utf8.len;
usize current = this.current;
if (current >= len) return IteratorResult.NO_MORE_ELEMENT!;
int read = (int)(len - current < 4 ? len - current : 4);
Char32 res = str::utf8CharTo32(&this.utf8[current], &read)?;
usize read = (len - current < 4 ? len - current : 4);
Char32 res = conv::utf8_to_char32(&this.utf8[current], &read)?;
this.current += read;
return res;
}