mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
fix(frontmatter): Have too few error match too many on close
This commit is contained in:
parent
0cbd02f093
commit
b6326d3255
@ -103,8 +103,11 @@ impl<'s> ScriptSource<'s> {
|
|||||||
let close_start = input.current_token_start();
|
let close_start = input.current_token_start();
|
||||||
let _ = input.next_slice(len);
|
let _ = input.next_slice(len);
|
||||||
let close_end = input.current_token_start();
|
let close_end = input.current_token_start();
|
||||||
|
let fewer_dashes = fence_length - len;
|
||||||
return Err(FrontmatterError::new(
|
return Err(FrontmatterError::new(
|
||||||
format!("closing code fence has too few `-`"),
|
format!(
|
||||||
|
"closing code fence has {fewer_dashes} less `-` than the opening fence"
|
||||||
|
),
|
||||||
close_start..close_end,
|
close_start..close_end,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[ERROR] closing code fence has too few `-`
|
[ERROR] closing code fence has 1 less `-` than the opening fence
|
||||||
--> script:3:1
|
--> script:3:1
|
||||||
|
|
|
|
||||||
3 | ---cargo
|
3 | ---cargo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user