Update range.rs

Stop creating a reference then immediately dereferencing it.
This commit is contained in:
frogtd 2021-07-27 16:14:48 -04:00 committed by GitHub
parent fd853c00e2
commit 47414aa1bd
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,
})
}