code: Use chained if-let's
This commit is contained in:
parent
f806bbd484
commit
8972c5efb9
12 changed files with 219 additions and 235 deletions
|
|
@ -63,10 +63,11 @@ pub fn apply_unicode_escapes(s: impl AsRef<str>) -> Option<String> {
|
|||
while let Some(c) = char_iter.next() {
|
||||
match state {
|
||||
State::None if c == '\\' => {
|
||||
if let (Some(c1), Some(c2)) = (char_iter.next(), char_iter.next()) {
|
||||
if c1 == 'u' && c2 == '{' {
|
||||
state = State::UnicodeHex;
|
||||
}
|
||||
if let (Some(c1), Some(c2)) = (char_iter.next(), char_iter.next())
|
||||
&& c1 == 'u'
|
||||
&& c2 == '{'
|
||||
{
|
||||
state = State::UnicodeHex;
|
||||
}
|
||||
}
|
||||
State::None => new.push(c),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue