1
Fork 0

Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiser

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

This simplifies some code :3

(there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
This commit is contained in:
bors 2022-11-24 00:17:35 +00:00
commit 872631d0f0
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");