Commit 6ef58ef
committed
treefile: Fix clippy char_indices_as_byte_indices lint
The split_whitespace_unless_quoted function was using chars().enumerate()
which returns character indices, but then using those indices to slice
the string which requires byte indices. This triggers the
char_indices_as_byte_indices clippy lint.
Fixed by using char_indices() instead, which provides byte indices
directly. Also refactored the end-of-string handling to occur after
the loop completes, which is clearer and handles the remaining text
properly regardless of multi-byte characters.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>1 parent 4b099f9 commit 6ef58ef
1 file changed
+9
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2086 | 2086 | | |
2087 | 2087 | | |
2088 | 2088 | | |
2089 | | - | |
| 2089 | + | |
2090 | 2090 | | |
2091 | 2091 | | |
2092 | 2092 | | |
| |||
2095 | 2095 | | |
2096 | 2096 | | |
2097 | 2097 | | |
2098 | | - | |
2099 | | - | |
2100 | | - | |
2101 | | - | |
2102 | | - | |
2103 | | - | |
2104 | | - | |
| 2098 | + | |
2105 | 2099 | | |
2106 | 2100 | | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
2107 | 2108 | | |
2108 | 2109 | | |
2109 | 2110 | | |
| |||
0 commit comments