Skip to content

Commit 4becfeb

Browse files
committed
Optimize tag getters for AccountId
1 parent 7d78bf1 commit 4becfeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/model/src/identifiers/account_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ impl AccountId {
8989
#[must_use]
9090
pub fn get_issuer(&self) -> Venue {
9191
// SAFETY: Account ID is guaranteed to have chars either side of a hyphen
92-
Venue::from_str_unchecked(self.0.split('-').collect::<Vec<&str>>().first().unwrap())
92+
Venue::from_str_unchecked(self.0.split_once('-').unwrap().0)
9393
}
9494

9595
/// Returns the account ID assigned by the issuer.
9696
#[must_use]
9797
pub fn get_issuers_id(&self) -> &str {
9898
// SAFETY: Account ID is guaranteed to have chars either side of a hyphen
99-
self.0.split('-').collect::<Vec<&str>>().last().unwrap()
99+
self.0.split_once('-').unwrap().1
100100
}
101101
}
102102

0 commit comments

Comments
 (0)