File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -224,21 +224,20 @@ fn split_source(input: &str) -> CargoResult<Source<'_>> {
224
224
source. content = content;
225
225
}
226
226
227
- // Experiment: let us try which char works better
228
- let fence_char = '-' ;
227
+ const FENCE_CHAR : char = '-' ;
229
228
230
229
let fence_end = source
231
230
. content
232
231
. char_indices ( )
233
- . find_map ( |( i, c) | ( c != fence_char ) . then_some ( i) )
232
+ . find_map ( |( i, c) | ( c != FENCE_CHAR ) . then_some ( i) )
234
233
. unwrap_or ( source. content . len ( ) ) ;
235
234
let ( fence_pattern, rest) = match fence_end {
236
235
0 => {
237
236
return Ok ( source) ;
238
237
}
239
238
1 | 2 => {
240
239
anyhow:: bail!(
241
- "found {fence_end} `{fence_char }` in rust frontmatter, expected at least 3"
240
+ "found {fence_end} `{FENCE_CHAR }` in rust frontmatter, expected at least 3"
242
241
)
243
242
}
244
243
_ => source. content . split_at ( fence_end) ,
You can’t perform that action at this time.
0 commit comments