mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00
Fix TODO directive out of bounds acccess (#13756)
This commit is contained in:
parent
04b636cba2
commit
72ac6cd5a5
4 changed files with 21 additions and 10 deletions
|
@ -316,7 +316,7 @@ impl<'a> TodoDirective<'a> {
|
|||
// Shrink the subset to check for the next phrase starting with "#".
|
||||
if let Some(new_offset) = trimmed.find('#') {
|
||||
relative_offset += TextSize::try_from(new_offset).unwrap();
|
||||
subset = &subset[relative_offset.to_usize()..];
|
||||
subset = &comment[relative_offset.to_usize()..];
|
||||
} else {
|
||||
break;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue