We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20efb19 commit 7795b15Copy full SHA for 7795b15
src/libfmt_macros/lib.rs
@@ -302,22 +302,19 @@ impl<'a> Parser<'a> {
302
}
303
304
305
- fn raw(&self) -> usize {
306
- self.style.map(|raw| raw + 1).unwrap_or(0)
307
- }
308
-
309
fn to_span_index(&self, pos: usize) -> SpanIndex {
310
let mut pos = pos;
+ let raw = self.style.map(|raw| raw + 1).unwrap_or(0);
311
for skip in &self.skips {
312
if pos > *skip {
313
pos += 1;
314
- } else if pos == *skip && self.raw() == 0 {
+ } else if pos == *skip && raw == 0 {
315
316
} else {
317
break;
318
319
320
- SpanIndex(self.raw() + pos + 1)
+ SpanIndex(raw + pos + 1)
321
322
323
/// Forces consumption of the specified character. If the character is not
0 commit comments