Skip to content

Commit

Permalink
test_merged_tree: avoid a temporary lifetime extension
Browse files Browse the repository at this point in the history
I think it's just clearer to assign the owned value to the variable
than to assign a reference to a temporary value.
  • Loading branch information
martinvonz committed Nov 27, 2024
1 parent 147b115 commit 9da9224
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tests/test_merged_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ fn test_from_legacy_tree() {

// dir1: directory without conflicts
let dir1_basename = RepoPathComponent::new("dir1");
let dir1_filename = &RepoPath::root()
let dir1_filename = RepoPath::root()
.join(dir1_basename)
.join(RepoPathComponent::new("file"));
let dir1_filename_id = write_file(store.as_ref(), dir1_filename, "file5_v2");
tree_builder.set(dir1_filename.to_owned(), file_value(&dir1_filename_id));
let dir1_filename_id = write_file(store.as_ref(), &dir1_filename, "file5_v2");
tree_builder.set(dir1_filename, file_value(&dir1_filename_id));

let tree_id = tree_builder.write_tree().unwrap();
let tree = store.get_tree(RepoPathBuf::root(), &tree_id).unwrap();
Expand Down

0 comments on commit 9da9224

Please sign in to comment.