Skip to content

Commit

Permalink
use String::from_utf8_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Mar 3, 2025
1 parent 103c9fa commit c22ae88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keypair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Keypair {
pub fn to_base58_string(&self) -> String {
let mut out = [0u8; five8::BASE58_ENCODED_64_MAX_LEN];
let len = five8::encode_64(&self.0.to_bytes(), &mut out);
out[..len as usize].iter().map(|c| *c as char).collect()
unsafe { String::from_utf8_unchecked(out[..len as usize].to_vec()) }
}

/// Gets this `Keypair`'s SecretKey
Expand Down

0 comments on commit c22ae88

Please sign in to comment.