-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imp: avoid unnecessary clones and validations when creating ClientId (#…
…1015) * imp: avoid unnecessary clones and validations when creating ClientId Introduce ClientType::get_client_id method which constructs a new ClientId but forgoes client type verification. The client type has already been verified at creation and the verification guarantees that formatted ClientId will also be valid. Furthermore, rewrite ClientId::new so that it doesn’t take ownership of the client type and doesn’t allocated temporary strings. Furthermore, since ClinetType::get_client_id is now a thing, change the client type argument to be `&str` so that constructing ids from string client type is easier. * wip * clippy * Update .changelog/unreleased/breaking-changes/1014-better-client-id-new.md Co-authored-by: Farhad Shabani <[email protected]> Signed-off-by: Michal Nazarewicz <[email protected]> * build_client_id * drop variant * Update 1014-better-client-id-new.md Signed-off-by: Michal Nazarewicz <[email protected]> --------- Signed-off-by: Michal Nazarewicz <[email protected]> Co-authored-by: Farhad Shabani <[email protected]>
- Loading branch information
1 parent
7ff743b
commit 9c29cb4
Showing
17 changed files
with
85 additions
and
103 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
.changelog/unreleased/breaking-changes/1014-better-client-id-new.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- `[ibc-core-host-types]` Introduce `ClientType::build_client_id` which avoids unnecessary validaiton. | ||
([#1014](https://github.com/cosmos/ibc-rs/issues/1014)) | ||
- `[ibc-core-host-types]` Optimise `ClientId::new` to avoid unnecessary validaiton and temporary | ||
string allocation. ([#1014](https://github.com/cosmos/ibc-rs/issues/1014)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.