declone and close the door (#12035)

* declone and close the door

* cargo fmt

* remove brackets
This commit is contained in:
Squirrel
2022-08-15 20:38:36 +01:00
committed by GitHub
parent 9c2a2495fe
commit a68a80fbae
72 changed files with 344 additions and 512 deletions
+1 -8
View File
@@ -1416,12 +1416,7 @@ mod tests {
loader.counter += 1;
loader.map.insert(
hash,
MockExecutable {
func: Rc::new(f),
func_type,
code_hash: hash.clone(),
refcount: 1,
},
MockExecutable { func: Rc::new(f), func_type, code_hash: hash, refcount: 1 },
);
hash
})
@@ -2189,7 +2184,6 @@ mod tests {
let dummy_ch = MockLoader::insert(Call, |_, _| exec_success());
let instantiated_contract_address = Rc::new(RefCell::new(None::<AccountIdOf<Test>>));
let instantiator_ch = MockLoader::insert(Call, {
let dummy_ch = dummy_ch.clone();
let instantiated_contract_address = Rc::clone(&instantiated_contract_address);
move |ctx, _| {
// Instantiate a contract and save it's address in `instantiated_contract_address`.
@@ -2252,7 +2246,6 @@ mod tests {
fn instantiation_traps() {
let dummy_ch = MockLoader::insert(Constructor, |_, _| Err("It's a trap!".into()));
let instantiator_ch = MockLoader::insert(Call, {
let dummy_ch = dummy_ch.clone();
move |ctx, _| {
// Instantiate a contract and save it's address in `instantiated_contract_address`.
assert_matches!(