diff --git a/regex-syntax/src/utf8.rs b/regex-syntax/src/utf8.rs index e13b55abf..69d749451 100644 --- a/regex-syntax/src/utf8.rs +++ b/regex-syntax/src/utf8.rs @@ -302,9 +302,9 @@ impl Utf8Sequences { /// Create a new iterator over UTF-8 byte ranges for the scalar value range /// given. pub fn new(start: char, end: char) -> Self { - let mut it = Utf8Sequences { range_stack: vec![] }; - it.push(u32::from(start), u32::from(end)); - it + let range = + ScalarRange { start: u32::from(start), end: u32::from(end) }; + Utf8Sequences { range_stack: vec![range] } } /// reset resets the scalar value range.