Enable clippy::clone_on_copy
(#8728)
This PR enables the [`clippy::clone_on_copy`](https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_copy) rule and fixes the outstanding violations. Release Notes: - N/A
This commit is contained in:
parent
5935681c5c
commit
9735912965
42 changed files with 144 additions and 160 deletions
|
@ -478,7 +478,7 @@ impl<'a> MutableSelectionsCollection<'a> {
|
|||
|
||||
if !oldest.start.cmp(&oldest.end, &self.buffer()).is_eq() {
|
||||
let head = oldest.head();
|
||||
oldest.start = head.clone();
|
||||
oldest.start = head;
|
||||
oldest.end = head;
|
||||
self.collection.disjoint = Arc::from([oldest]);
|
||||
self.selections_changed = true;
|
||||
|
@ -794,8 +794,8 @@ impl<'a> MutableSelectionsCollection<'a> {
|
|||
let adjusted_disjoint: Vec<_> = anchors_with_status
|
||||
.chunks(2)
|
||||
.map(|selection_anchors| {
|
||||
let (anchor_ix, start, kept_start) = selection_anchors[0].clone();
|
||||
let (_, end, kept_end) = selection_anchors[1].clone();
|
||||
let (anchor_ix, start, kept_start) = selection_anchors[0];
|
||||
let (_, end, kept_end) = selection_anchors[1];
|
||||
let selection = &self.disjoint[anchor_ix / 2];
|
||||
let kept_head = if selection.reversed {
|
||||
kept_start
|
||||
|
@ -826,8 +826,8 @@ impl<'a> MutableSelectionsCollection<'a> {
|
|||
let buffer = self.buffer();
|
||||
let anchors =
|
||||
buffer.refresh_anchors([&pending.selection.start, &pending.selection.end]);
|
||||
let (_, start, kept_start) = anchors[0].clone();
|
||||
let (_, end, kept_end) = anchors[1].clone();
|
||||
let (_, start, kept_start) = anchors[0];
|
||||
let (_, end, kept_end) = anchors[1];
|
||||
let kept_head = if pending.selection.reversed {
|
||||
kept_start
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue