From 20dd42c003f15c4b184349c8ea82acdf74970fa3 Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Tue, 30 Apr 2024 21:21:41 +0200 Subject: [PATCH] use expect over comment for safety --- ibc-testkit/src/testapp/ibc/core/client_ctx.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ibc-testkit/src/testapp/ibc/core/client_ctx.rs b/ibc-testkit/src/testapp/ibc/core/client_ctx.rs index bdf0b239f..839a00ce1 100644 --- a/ibc-testkit/src/testapp/ibc/core/client_ctx.rs +++ b/ibc-testkit/src/testapp/ibc/core/client_ctx.rs @@ -92,7 +92,7 @@ where ) -> Result, ContextError> { let path = format!("clients/{client_id}/consensusStates") .try_into() - .unwrap(); // safety - path must be valid since ClientId and height are valid Identifiers + .expect("Must be valid path: ClientId and height are valid Identifiers"); let keys = self.store.get_keys(&path); let found_path = keys.into_iter().find_map(|path| { @@ -127,7 +127,7 @@ where ) -> Result, ContextError> { let path = format!("clients/{client_id}/consensusStates") .try_into() - .unwrap(); // safety - path must be valid since ClientId and height are valid Identifiers + .expect("Must be valid path: ClientId and height are valid Identifiers"); let keys = self.store.get_keys(&path); let found_path = keys.into_iter().rev().find_map(|path| {