From 9da9224b43ea74bcf9aa1e9a63a3fde687339412 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 27 Nov 2024 14:59:04 -0800 Subject: [PATCH] test_merged_tree: avoid a temporary lifetime extension I think it's just clearer to assign the owned value to the variable than to assign a reference to a temporary value. --- lib/tests/test_merged_tree.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tests/test_merged_tree.rs b/lib/tests/test_merged_tree.rs index b32e1be3c6..a12ba01c98 100644 --- a/lib/tests/test_merged_tree.rs +++ b/lib/tests/test_merged_tree.rs @@ -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();