aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-06 02:20:53 +0100
committerTeddy Wing2018-11-06 02:23:35 +0100
commitab1c6cedb642263ba25812457e60c4e7b1464f0b (patch)
tree89ecbca915e40a6f168190bc1f6a4a64f0341b78
parentb1c8efdcbbd31de8ca7e5fbc488eec0b0bf00572 (diff)
downloaddome-key-web-ab1c6cedb642263ba25812457e60c4e7b1464f0b.tar.bz2
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.
-rw-r--r--license-generator/aquatic-prime/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
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::<Vec<&str>>()
.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")?;