Fix new nightly lints

This commit is contained in:
Lukas Wirth 2024-10-22 11:02:41 +02:00
parent 232432411e
commit 6c23f25e7f
24 changed files with 81 additions and 51 deletions

View file

@ -79,7 +79,7 @@ impl CommentBlock {
let mut block = dummy_block.clone();
for (line_num, line) in lines.enumerate() {
match line.strip_prefix("//") {
Some(mut contents) => {
Some(mut contents) if !contents.starts_with('/') => {
if let Some('/' | '!') = contents.chars().next() {
contents = &contents[1..];
block.is_doc = true;
@ -89,7 +89,7 @@ impl CommentBlock {
}
block.contents.push(contents.to_owned());
}
None => {
_ => {
if !block.contents.is_empty() {
let block = mem::replace(&mut block, dummy_block.clone());
res.push(block);