Skip to content

Fix "not a character boundary" panic in missing_copyright_notice #7015

@MichaReiser

Description

@MichaReiser

The missing copyright notice only looks at the 1024 first bytes. However, this can go wrong for unicode text if the 1024 byte is not a character boundary (because it is a multibyte character).

let contents = if locator.len() < 1024 {
locator.contents()
} else {
locator.up_to(TextSize::from(1024))
};

Fix: Use is_char_boundary to find a valid char boundary close to 1024.

locator.contents().is_char_boundary(1024)

Metadata

Metadata

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedContributions especially welcome

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions