Use as_deref in compiler (but only where it makes sense)

This commit is contained in:
Maybe Waffle 2022-11-16 21:58:58 +00:00
parent e702534763
commit 94470f4efd
27 changed files with 45 additions and 63 deletions

View file

@ -132,8 +132,7 @@ fn test_unescape_str_good() {
}
}
});
let buf = buf.as_ref().map(|it| it.as_ref());
assert_eq!(buf, Ok(expected))
assert_eq!(buf.as_deref(), Ok(expected))
}
check("foo", "foo");
@ -250,8 +249,7 @@ fn test_unescape_byte_str_good() {
}
}
});
let buf = buf.as_ref().map(|it| it.as_ref());
assert_eq!(buf, Ok(expected))
assert_eq!(buf.as_deref(), Ok(expected))
}
check("foo", b"foo");