We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
let...else
1 parent 5cdd78b commit 85f81baCopy full SHA for 85f81ba
libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -991,8 +991,11 @@ fn find_width_map_from_snippet(
991
// If we only trimmed it off the input, `format!("\n")` would cause a mismatch as here we they actually match up.
992
// Alternatively, we could just count the trailing newlines and only trim one from the input if they don't match up.
993
let input_no_nl = input.trim_end_matches('\n');
994
- let Some(unescaped) = unescape_string(snippet) else {
995
- return InputStringKind::NotALiteral;
+ let unescaped = match unescape_string(snippet) {
+ Some(unescaped) => unescaped,
996
+ _ => {
997
+ return InputStringKind::NotALiteral;
998
+ }
999
};
1000
1001
let unescaped_no_nl = unescaped.trim_end_matches('\n');
0 commit comments