From 927febe4e893046758ee1d378be5b8faebece7fa Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Thu, 28 Sep 2017 16:52:12 -0600 Subject: [PATCH 1/3] Bump version to 0.12.0. --- Cargo.toml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c0457a2..4c76c63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "pairing" # Remember to change version string in README.md. -version = "0.11.0" +version = "0.12.0" authors = ["Sean Bowe "] license = "MIT/Apache-2.0" diff --git a/README.md b/README.md index 21086e8..9b3ae6f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you're using a supported platform and the nightly Rust compiler, you can enab ```toml [dependencies.pairing] -version = "0.11" +version = "0.12" features = ["u128-support"] ``` From 05339414cc132555d3e4c93ba7d5ca18c3e94954 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Thu, 28 Sep 2017 17:10:06 -0600 Subject: [PATCH 2/3] Update clippy and compensate for new lints. --- Cargo.toml | 2 +- src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4c76c63..bac829e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://github.com/ebfull/pairing" [dependencies] rand = "0.3" byteorder = "1.1.0" -clippy = { version = "0.0.151", optional = true } +clippy = { version = "0.0.165", optional = true } [features] unstable-features = [] diff --git a/src/lib.rs b/src/lib.rs index dc5d330..8b80ef3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,7 @@ #![cfg_attr(feature = "clippy", allow(too_many_arguments))] #![cfg_attr(feature = "clippy", allow(unreadable_literal))] #![cfg_attr(feature = "clippy", allow(new_without_default_derive))] +#![cfg_attr(feature = "clippy", allow(expl_impl_clone_on_copy))] // TODO // Force public structures to implement Debug #![deny(missing_debug_implementations)] @@ -519,7 +520,7 @@ pub trait PrimeField: Field } res.mul_assign(&ten); - res.add_assign(&Self::from_repr(Self::Repr::from(c as u64)).unwrap()); + res.add_assign(&Self::from_repr(Self::Repr::from(u64::from(c))).unwrap()); }, None => { return None; From 67f5fbc94c1ef45cb6c1ae3d428dccc4b2561399 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Thu, 28 Sep 2017 17:37:54 -0600 Subject: [PATCH 3/3] More modifications to satisfy clippy. --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8b80ef3..c39615c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -623,7 +623,7 @@ mod arith { /// the borrow value. #[inline(always)] pub(crate) fn sbb(a: u64, b: u64, borrow: &mut u64) -> u64 { - let tmp = (1u128 << 64) + (a as u128) - (b as u128) - (*borrow as u128); + let tmp = (1u128 << 64) + u128::from(a) - u128::from(b) - u128::from(*borrow); *borrow = if tmp >> 64 == 0 { 1 } else { 0 }; @@ -634,7 +634,7 @@ mod arith { /// carry value. #[inline(always)] pub(crate) fn adc(a: u64, b: u64, carry: &mut u64) -> u64 { - let tmp = (a as u128) + (b as u128) + (*carry as u128); + let tmp = u128::from(a) + u128::from(b) + u128::from(*carry); *carry = (tmp >> 64) as u64; @@ -645,7 +645,7 @@ mod arith { /// and setting carry to the most significant digit. #[inline(always)] pub(crate) fn mac_with_carry(a: u64, b: u64, c: u64, carry: &mut u64) -> u64 { - let tmp = (a as u128) + (b as u128) * (c as u128) + (*carry as u128); + let tmp = (u128::from(a)) + u128::from(b) * u128::from(c) + u128::from(*carry); *carry = (tmp >> 64) as u64;