style(tests): do not use .as_bytes().len() on strings
This commit is contained in:
parent
c1f8a8a728
commit
1aa28e04ee
2 changed files with 2 additions and 2 deletions
|
|
@ -735,7 +735,7 @@ fn index_of(text: &[u8], substring: &str) -> usize {
|
|||
|
||||
fn range_of(text: &[u8], substring: &str) -> Range {
|
||||
let start_byte = index_of(text, substring);
|
||||
let end_byte = start_byte + substring.as_bytes().len();
|
||||
let end_byte = start_byte + substring.len();
|
||||
Range {
|
||||
start_byte,
|
||||
end_byte,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue