summaryrefslogtreecommitdiff
path: root/src/handlers/diff_header_diff.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2024-05-04 10:00:44 -0400
committerGitHub <noreply@github.com>2024-05-04 10:00:44 -0400
commitd995bf76cfe3ce4d0a89e4da647692319ee88c38 (patch)
treeef300de2636b6322ddaad5b05e22d34875ab5ece /src/handlers/diff_header_diff.rs
parent711353b4dd3c3c1c740c586d6a0ddab9d68c8b07 (diff)
clippy (#1686)
Diffstat (limited to 'src/handlers/diff_header_diff.rs')
-rw-r--r--src/handlers/diff_header_diff.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/handlers/diff_header_diff.rs b/src/handlers/diff_header_diff.rs
index f8a007e..d8c5319 100644
--- a/src/handlers/diff_header_diff.rs
+++ b/src/handlers/diff_header_diff.rs
@@ -25,7 +25,7 @@ impl<'a> StateMachine<'a> {
};
self.handle_pending_line_with_diff_name()?;
self.handled_diff_header_header_line_file_pair = None;
- self.diff_line = self.line.clone();
+ self.diff_line.clone_from(&self.line);
// Pre-fill header fields from the diff line. For added, removed or renamed files
// these are updated precisely on actual header minus and header plus lines.
@@ -33,8 +33,8 @@ impl<'a> StateMachine<'a> {
// are no minus and plus lines. Without the code below, in such cases the file names
// would remain unchanged from the previous diff, or empty for the very first diff.
let name = get_repeated_file_path_from_diff_line(&self.line).unwrap_or_default();
- self.minus_file = name.clone();
- self.plus_file = name.clone();
+ self.minus_file.clone_from(&name);
+ self.plus_file.clone_from(&name);
self.minus_file_event = FileEvent::Change;
self.plus_file_event = FileEvent::Change;
self.current_file_pair = Some((self.minus_file.clone(), self.plus_file.clone()));