Skip to content

Commit

Permalink
refactor: use explicit .clone() where possible, instead of "to owne…
Browse files Browse the repository at this point in the history
…d"-like methods
  • Loading branch information
eduardosm committed Sep 9, 2024
1 parent 9bd387b commit 4625014
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/git/import/temp_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl TempStorage {
.write(true)
.open(&path)
.map_err(|e| ImportError::CreateFileError {
path: path.to_path_buf(),
path: path.clone(),
error: e,
})?;

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ fn main_inner() -> Result<(), RunError> {
})?;
conv_params_path_parent.join(user_map_path)
} else {
user_map_path.to_path_buf()
user_map_path.clone()
};

let user_map_file = std::fs::OpenOptions::new()
Expand Down
2 changes: 1 addition & 1 deletion src/user_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl UserMap {

match parse_line(&line) {
Some(Some((user, entry))) => {
map.entry(user.to_vec()).or_default().push(entry);
map.entry(user.clone()).or_default().push(entry);
}
Some(None) => {}
None => return Err(AuthorMapParseError::BadLine(line_i, line)),
Expand Down

0 comments on commit 4625014

Please sign in to comment.