Make toml.Scanner.peek return u32

pull/13967/head
Nick Treleaven 2022-04-07 19:44:18 +01:00
parent fb3afe884b
commit 4744fcee13
1 changed files with 1 additions and 1 deletions

View File

@ -315,7 +315,7 @@ fn (s Scanner) at_crlf() bool {
// peek returns the character code from the input text at position + `n`. // peek returns the character code from the input text at position + `n`.
// peek returns `end_of_text` if it can't peek `n` characters ahead. // peek returns `end_of_text` if it can't peek `n` characters ahead.
[direct_array_access; inline] [direct_array_access; inline]
pub fn (s &Scanner) peek(n int) int { pub fn (s &Scanner) peek(n int) u32 {
if s.pos + n < s.text.len { if s.pos + n < s.text.len {
// Allow peeking back - needed for spaces between date and time in RFC 3339 format :/ // Allow peeking back - needed for spaces between date and time in RFC 3339 format :/
if n - 1 < 0 && s.pos + n - 1 >= 0 { if n - 1 < 0 && s.pos + n - 1 >= 0 {