Skip to content

Commit

Permalink
Fix typo in string_token_flags.rs (#10476)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Mar 19, 2024
1 parent 17d56cc commit ffd6e79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ expression: parse_ast
flags: BytesLiteralFlags {
quote_style: Single,
prefix: Raw {
uppercase_r: true,
uppercase_r: false,
},
triple_quoted: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ expression: parse_ast
flags: BytesLiteralFlags {
quote_style: Single,
prefix: Raw {
uppercase_r: true,
uppercase_r: false,
},
triple_quoted: false,
},
Expand Down
6 changes: 3 additions & 3 deletions crates/ruff_python_parser/src/string_token_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ impl StringPrefix {

// bytestrings
if flags.contains(StringFlags::B_PREFIX) {
if flags.contains(StringFlags::R_PREFIX_LOWER) {
return Self::Bytes(ByteStringPrefix::Raw { uppercase_r: true });
}
if flags.contains(StringFlags::R_PREFIX_LOWER) {
return Self::Bytes(ByteStringPrefix::Raw { uppercase_r: false });
}
if flags.contains(StringFlags::R_PREFIX_UPPER) {
return Self::Bytes(ByteStringPrefix::Raw { uppercase_r: true });
}
return Self::Bytes(ByteStringPrefix::Regular);
}

Expand Down

0 comments on commit ffd6e79

Please sign in to comment.