Rollup merge of #87523 - frogtd:patch-2, r=dtolnay

Stop creating a reference then immediately dereferencing it.

Stop creating a reference then immediately dereferencing it.
This commit is contained in:
Yuki Okushi 2021-07-28 18:28:22 +09:00 committed by GitHub
commit 4ae529688a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -812,12 +812,12 @@ pub trait RangeBounds<T: ?Sized> {
U: ?Sized + PartialOrd<T>,
{
(match self.start_bound() {
Included(ref start) => *start <= item,
Excluded(ref start) => *start < item,
Included(start) => start <= item,
Excluded(start) => start < item,
Unbounded => true,
}) && (match self.end_bound() {
Included(ref end) => item <= *end,
Excluded(ref end) => item < *end,
Included(end) => item <= end,
Excluded(end) => item < end,
Unbounded => true,
})
}