Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update range.rs
Stop creating a reference then immediately dereferencing it.
  • Loading branch information
frogtd authored Jul 27, 2021
commit 47414aa1bd0e4dc3bd8ef06dcea6b85e510d0912
8 changes: 4 additions & 4 deletions library/core/src/ops/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
Expand Down