diff --git a/src/utf16.rs b/src/utf16.rs index 4350108..3b46814 100644 --- a/src/utf16.rs +++ b/src/utf16.rs @@ -98,7 +98,7 @@ fn encode_code_point(unicode_cp: u32) -> Vec { /// # Panics /// * If the index `i` is out of bounds. /// * If the UTF-16 code point is invalid. -fn decode_symbol(utf16_cp: &Vec, i: usize) -> Option<(u32, usize)> { +fn decode_symbol(utf16_cp: &[u16], i: usize) -> Option<(u32, usize)> { if i > utf16_cp.len() { panic!("Index out of bounds"); } diff --git a/src/utf8.rs b/src/utf8.rs index 10ae1cc..f46326f 100644 --- a/src/utf8.rs +++ b/src/utf8.rs @@ -148,7 +148,7 @@ fn encode_code_point(unicode_cp: u32) -> Vec { /// # Panics /// * If the index `i` is out of bounds. /// * If the byte at index `i` is not a continuation byte. -fn read_next_byte(byte_vec: &Vec, i: usize) -> u32 { +fn read_next_byte(byte_vec: &[u8], i: usize) -> u32 { if i >= byte_vec.len() { panic!("Index out of bounds"); }