From ab1c6cedb642263ba25812457e60c4e7b1464f0b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 6 Nov 2018 02:20:53 +0100 Subject: AquaticPrime::sign(): Remove `unwrap`s from key "0x" removal Gets rid of `unwrap`s and allows us to explicitly remove only "0x". Still on Rust 1.28 for now. Will need to change this to `trim_start_matches` for Rust v1.30. --- license-generator/aquatic-prime/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'license-generator') diff --git a/license-generator/aquatic-prime/src/lib.rs b/license-generator/aquatic-prime/src/lib.rs index 14a2bef..26666a1 100644 --- a/license-generator/aquatic-prime/src/lib.rs +++ b/license-generator/aquatic-prime/src/lib.rs @@ -35,8 +35,8 @@ impl<'a> AquaticPrime<'a> { .collect::>() .concat(); - let public_key = self.public_key.get(2..).unwrap(); - let private_key = self.private_key.get(2..).unwrap(); + let public_key = self.public_key.trim_left_matches("0x"); + let private_key = self.private_key.trim_left_matches("0x"); let public_key = BigNum::from_hex_str(public_key) .chain_err(|| "public key could not be converted to BigNum")?; -- cgit v1.2.3