diff options
| author | frogtd <31412003+frogtd@users.noreply.github.com> | 2021-07-27 16:14:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-27 16:14:48 -0400 |
| commit | 47414aa1bd0e4dc3bd8ef06dcea6b85e510d0912 (patch) | |
| tree | 4f782830e591d55b49f577409855f277e0143c8a | |
| parent | fd853c00e255559255885aadff9e93a1760c8728 (diff) | |
| download | rust-47414aa1bd0e4dc3bd8ef06dcea6b85e510d0912.tar.gz rust-47414aa1bd0e4dc3bd8ef06dcea6b85e510d0912.zip | |
Update range.rs
Stop creating a reference then immediately dereferencing it.
| -rw-r--r-- | library/core/src/ops/range.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/ops/range.rs b/library/core/src/ops/range.rs index 9bf0382312e..347a346359f 100644 --- a/library/core/src/ops/range.rs +++ b/library/core/src/ops/range.rs @@ -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, }) } |
