Skip to content

Commit

Permalink
Add comment about raw strings to self.style
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Jun 9, 2019
1 parent b1c357e commit 6b9740b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libfmt_macros/lib.rs
Expand Up @@ -301,6 +301,8 @@ impl<'a> Parser<'a> {

fn to_span_index(&self, pos: usize) -> InnerOffset {
let mut pos = pos;
// This handles the raw string case, the raw argument is the number of #
// in r###"..."### (we need to add one because of the `r`).
let raw = self.style.map(|raw| raw + 1).unwrap_or(0);
for skip in &self.skips {
if pos > *skip {
Expand Down

0 comments on commit 6b9740b

Please sign in to comment.