diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-16 21:58:58 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-16 21:58:58 +0000 |
| commit | 94470f4efd2ec0786dd1f201e9ea84651b4bb0d0 (patch) | |
| tree | 1bcf415fa3d0bedc9b223162446ab9653c8f5bec /compiler/rustc_lexer/src | |
| parent | e702534763599db252f2ca308739ec340d0933de (diff) | |
| download | rust-94470f4efd2ec0786dd1f201e9ea84651b4bb0d0.tar.gz rust-94470f4efd2ec0786dd1f201e9ea84651b4bb0d0.zip | |
Use `as_deref` in compiler (but only where it makes sense)
Diffstat (limited to 'compiler/rustc_lexer/src')
| -rw-r--r-- | compiler/rustc_lexer/src/unescape/tests.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_lexer/src/unescape/tests.rs b/compiler/rustc_lexer/src/unescape/tests.rs index c7ca8fd16ae..1c25b03fdb2 100644 --- a/compiler/rustc_lexer/src/unescape/tests.rs +++ b/compiler/rustc_lexer/src/unescape/tests.rs @@ -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"); |
