diff --git a/ethers-core/src/utils/anvil.rs b/ethers-core/src/utils/anvil.rs index 1c8f59c2..b4d12ee1 100644 --- a/ethers-core/src/utils/anvil.rs +++ b/ethers-core/src/utils/anvil.rs @@ -250,7 +250,7 @@ impl Anvil { let mut child = cmd.spawn().expect("couldnt start anvil"); - let stdout = child.stdout.expect("Unable to get stdout for anvil child process"); + let stdout = child.stdout.take().expect("Unable to get stdout for anvil child process"); let start = Instant::now(); let mut reader = BufReader::new(stdout); @@ -284,8 +284,6 @@ impl Anvil { } } - child.stdout = Some(reader.into_inner()); - AnvilInstance { pid: child, private_keys, addresses, port, chain_id: self.chain_id } } }