diff --git a/modules/src/mock/context.rs b/modules/src/mock/context.rs index 47319c40c2..c656363513 100644 --- a/modules/src/mock/context.rs +++ b/modules/src/mock/context.rs @@ -394,9 +394,9 @@ impl ChannelKeeper for MockContext { fn next_channel_id(&mut self) -> ChannelId { let prefix = ChannelId::default().to_string(); let suffix = self.channel_ids_counter; - let channel_id = ChannelId::from_str(format!("{}-{}", prefix, suffix).as_str()).unwrap(); self.channel_ids_counter += 1; - channel_id + + ChannelId::from_str(format!("{}-{}", prefix, suffix).as_str()).unwrap() } fn store_channel( @@ -499,10 +499,9 @@ impl ConnectionKeeper for MockContext { fn next_connection_id(&mut self) -> ConnectionId { let prefix = ConnectionId::default().to_string(); let suffix = self.connection_ids_counter; - let connection_id = - ConnectionId::from_str(format!("{}-{}", prefix, suffix).as_str()).unwrap(); self.connection_ids_counter += 1; - connection_id + + ConnectionId::from_str(format!("{}-{}", prefix, suffix).as_str()).unwrap() } fn store_connection( diff --git a/modules/tests/model_based.rs b/modules/tests/model_based.rs index 3d2d7852ed..f4213fffaa 100644 --- a/modules/tests/model_based.rs +++ b/modules/tests/model_based.rs @@ -299,10 +299,10 @@ fn main() { for test in tests { let path = format!("{}/{}.json", TESTS_DIR, test); - let test_executor = ICS02TestExecutor::new(); + let executor = ICS02TestExecutor::new(); // we should be able to just return the `Result` once the following issue // is fixed: https://github.com/rust-lang/rust/issues/43301 - if let Err(e) = modelator::test_driver(test_executor, path) { + if let Err(e) = modelator::test_driver(executor, path) { panic!("{:?}", e); } }