Skip to content

Commit

Permalink
skip clippy::result_unit_err check
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencil-Yao committed Jan 7, 2021
1 parent 6d3ed3f commit d0f3563
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sm2/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ impl EccCtx {
ret
}

#[allow(clippy::result_unit_err)]
pub fn bytes_to_point(&self, b: &[u8]) -> Result<Point, ()> {
let ctx = &self.fctx;

Expand Down
1 change: 1 addition & 0 deletions src/sm2/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ impl FieldCtx {
}

// Square root of a field element
#[allow(clippy::result_unit_err)]
pub fn sqrt(&self, g: &FieldElem) -> Result<FieldElem, ()> {
// p = 4 * u + 3
// u = u + 1
Expand Down
3 changes: 3 additions & 0 deletions src/sm2/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl Signature {
Ok(Signature { r, s })
}

#[allow(clippy::result_unit_err)]
pub fn der_decode_raw(buf: &[u8]) -> Result<Signature, ()> {
if buf[0] != 0x02 {
return Err(());
Expand Down Expand Up @@ -303,6 +304,7 @@ impl SigCtx {
curve.mul(&sk, &curve.generator())
}

#[allow(clippy::result_unit_err)]
pub fn load_pubkey(&self, buf: &[u8]) -> Result<Point, ()> {
self.curve.bytes_to_point(buf)
}
Expand All @@ -311,6 +313,7 @@ impl SigCtx {
self.curve.point_to_bytes(p, compress)
}

#[allow(clippy::result_unit_err)]
pub fn load_seckey(&self, buf: &[u8]) -> Result<BigUint, ()> {
if buf.len() != 32 {
return Err(());
Expand Down

0 comments on commit d0f3563

Please sign in to comment.