Skip to content

Commit

Permalink
Revert "CatalogBuilder::new_chained(): pass "chained_catalog" by value"
Browse files Browse the repository at this point in the history
This reverts commit 94530f9.
  • Loading branch information
s373r committed Jun 20, 2024
1 parent b47c119 commit 66512d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dill/src/catalog_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ impl CatalogBuilder {
}
}

pub fn new_chained(chained_catalog: Catalog) -> Self {
pub fn new_chained(chained_catalog: &Catalog) -> Self {
Self {
builders: HashMap::new(),
bindings: MultiMap::new(),
chained_catalog: Some(chained_catalog),
chained_catalog: Some(chained_catalog.clone()),
}
}

Expand Down
2 changes: 1 addition & 1 deletion dill/tests/tests/test_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn test_chained_catalog_binds() {
.bind::<dyn B, BImpl>()
.build();

let cat_later = CatalogBuilder::new_chained(cat_earlier.clone())
let cat_later = CatalogBuilder::new_chained(&cat_earlier)
.add::<AImpl>()
.bind::<dyn A, AImpl>()
.build();
Expand Down
2 changes: 1 addition & 1 deletion dill/tests/tests/test_scopes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn test_chained_singleton() {
.bind::<dyn A, AImpl>()
.build();

let cat_later = dill::CatalogBuilder::new_chained(cat_earlier.clone())
let cat_later = dill::CatalogBuilder::new_chained(&cat_earlier)
.add_value(BImpl::new("unique".to_string()))
.bind::<dyn B, BImpl>()
.build();
Expand Down

0 comments on commit 66512d4

Please sign in to comment.