File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -148,17 +148,17 @@ impl<'s> ScriptSource<'s> {
148
148
149
149
const FENCE_CHAR : char = '-' ;
150
150
151
- let mut trimmed_content = source. content ;
152
- while !trimmed_content . is_empty ( ) {
153
- let c = trimmed_content ;
151
+ let mut rest = source. content ;
152
+ while !rest . is_empty ( ) {
153
+ let c = rest ;
154
154
let c = c. trim_start_matches ( [ ' ' , '\t' ] ) ;
155
155
let c = c. trim_start_matches ( [ '\r' , '\n' ] ) ;
156
- if c == trimmed_content {
156
+ if c == rest {
157
157
break ;
158
158
}
159
- trimmed_content = c;
159
+ rest = c;
160
160
}
161
- let fence_end = trimmed_content
161
+ let fence_end = rest
162
162
. char_indices ( )
163
163
. find_map ( |( i, c) | ( c != FENCE_CHAR ) . then_some ( i) )
164
164
. unwrap_or ( source. content . len ( ) ) ;
@@ -171,7 +171,7 @@ impl<'s> ScriptSource<'s> {
171
171
"found {fence_end} `{FENCE_CHAR}` in rust frontmatter, expected at least 3"
172
172
)
173
173
}
174
- _ => trimmed_content . split_at ( fence_end) ,
174
+ _ => rest . split_at ( fence_end) ,
175
175
} ;
176
176
let ( info, content) = rest. split_once ( "\n " ) . unwrap_or ( ( rest, "" ) ) ;
177
177
let info = info. trim ( ) ;
You can’t perform that action at this time.
0 commit comments