Commit 9914f3c
guoyu
fix: handle multi-byte UTF-8 identifiers in
`split_numeric_suffix` used `rfind` to locate the last non-numeric
character and then split at `pos + 1`. Since `rfind` returns a byte
offset, this panics when the last non-numeric character is multi-byte
(e.g. CJK identifiers like `日本語`).
Use `str::ceil_char_boundary` to advance past the full character before
splitting.NameGenerator::suggest_name
1 parent 3e832f3 commit 9914f3c
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
265 | | - | |
| 271 | + | |
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
269 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
| |||
0 commit comments