From cee69d16656fd485c59363bfd6be6b5ab8d86d22 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 8 Dec 2023 17:38:20 +0900 Subject: [PATCH] tests: remove index downcast helpers called only by as__composite() I'm going to rename the impl types, and I don't want to think about the names of these downcast functions. --- lib/tests/test_index.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/tests/test_index.rs b/lib/tests/test_index.rs index c23ef8e8a..9a0248c63 100644 --- a/lib/tests/test_index.rs +++ b/lib/tests/test_index.rs @@ -443,26 +443,20 @@ fn create_n_commits( tx.commit() } -fn as_readonly_wrapper(repo: &Arc) -> &ReadonlyIndexWrapper { +fn as_readonly_composite(repo: &Arc) -> CompositeIndex<'_> { repo.readonly_index() .as_any() .downcast_ref::() .unwrap() + .as_composite() } -fn as_readonly_composite(repo: &Arc) -> CompositeIndex<'_> { - as_readonly_wrapper(repo).as_composite() -} - -fn as_mutable_impl(repo: &MutableRepo) -> &MutableIndexImpl { +fn as_mutable_composite(repo: &MutableRepo) -> CompositeIndex<'_> { repo.mutable_index() .as_any() .downcast_ref::() .unwrap() -} - -fn as_mutable_composite(repo: &MutableRepo) -> CompositeIndex<'_> { - as_mutable_impl(repo).as_composite() + .as_composite() } fn commits_by_level(repo: &Arc) -> Vec {