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:
Marshall Bowers 2024-03-02 17:37:48 -05:00 committed by GitHub
parent 5935681c5c
commit 9735912965
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 144 additions and 160 deletions

View file

@ -55,12 +55,12 @@ impl Anchor {
if let Some(excerpt) = snapshot.excerpt(self.excerpt_id) {
return Self {
buffer_id: self.buffer_id,
excerpt_id: self.excerpt_id.clone(),
excerpt_id: self.excerpt_id,
text_anchor: self.text_anchor.bias_left(&excerpt.buffer),
};
}
}
self.clone()
*self
}
pub fn bias_right(&self, snapshot: &MultiBufferSnapshot) -> Anchor {
@ -68,12 +68,12 @@ impl Anchor {
if let Some(excerpt) = snapshot.excerpt(self.excerpt_id) {
return Self {
buffer_id: self.buffer_id,
excerpt_id: self.excerpt_id.clone(),
excerpt_id: self.excerpt_id,
text_anchor: self.text_anchor.bias_right(&excerpt.buffer),
};
}
}
self.clone()
*self
}
pub fn summary<D>(&self, snapshot: &MultiBufferSnapshot) -> D