Update secp256k1-sys to edition 2018 and fix imports
This commit is contained in:
parent
ebe46a4d4e
commit
26a52bc8c8
|
@ -13,6 +13,7 @@ keywords = [ "secp256k1", "libsecp256k1", "ffi" ]
|
|||
readme = "README.md"
|
||||
build = "build.rs"
|
||||
links = "rustsecp256k1_v0_5_0"
|
||||
edition = "2018"
|
||||
|
||||
# Should make docs.rs show all functions, even those behind non-default features
|
||||
[package.metadata.docs.rs]
|
||||
|
|
|
@ -17,10 +17,7 @@
|
|||
//! not be needed for most users.
|
||||
|
||||
// Coding conventions
|
||||
#![deny(non_upper_case_globals)]
|
||||
#![deny(non_camel_case_types)]
|
||||
#![deny(non_snake_case)]
|
||||
#![deny(unused_mut)]
|
||||
#![deny(non_upper_case_globals, non_camel_case_types, non_snake_case, unused_mut)]
|
||||
|
||||
#![cfg_attr(all(not(test), not(feature = "std")), no_std)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
@ -31,7 +28,6 @@ extern crate core;
|
|||
#[cfg(fuzzing)]
|
||||
const THIS_UNUSED_CONSTANT_IS_YOUR_WARNING_THAT_ALL_THE_CRYPTO_IN_THIS_LIB_IS_DISABLED_FOR_FUZZING: usize = 0;
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
pub mod types;
|
||||
|
||||
|
|
|
@ -69,14 +69,14 @@ macro_rules! impl_array_newtype {
|
|||
|
||||
impl PartialOrd for $thing {
|
||||
#[inline]
|
||||
fn partial_cmp(&self, other: &$thing) -> Option<::core::cmp::Ordering> {
|
||||
fn partial_cmp(&self, other: &$thing) -> Option<core::cmp::Ordering> {
|
||||
self[..].partial_cmp(&other[..])
|
||||
}
|
||||
}
|
||||
|
||||
impl Ord for $thing {
|
||||
#[inline]
|
||||
fn cmp(&self, other: &$thing) -> ::core::cmp::Ordering {
|
||||
fn cmp(&self, other: &$thing) -> core::cmp::Ordering {
|
||||
self[..].cmp(&other[..])
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ macro_rules! impl_array_newtype {
|
|||
}
|
||||
}
|
||||
|
||||
impl ::core::ops::Index<usize> for $thing {
|
||||
impl core::ops::Index<usize> for $thing {
|
||||
type Output = $ty;
|
||||
|
||||
#[inline]
|
||||
|
@ -99,41 +99,41 @@ macro_rules! impl_array_newtype {
|
|||
}
|
||||
}
|
||||
|
||||
impl ::core::ops::Index<::core::ops::Range<usize>> for $thing {
|
||||
impl core::ops::Index<core::ops::Range<usize>> for $thing {
|
||||
type Output = [$ty];
|
||||
|
||||
#[inline]
|
||||
fn index(&self, index: ::core::ops::Range<usize>) -> &[$ty] {
|
||||
fn index(&self, index: core::ops::Range<usize>) -> &[$ty] {
|
||||
let &$thing(ref dat) = self;
|
||||
&dat[index]
|
||||
}
|
||||
}
|
||||
|
||||
impl ::core::ops::Index<::core::ops::RangeTo<usize>> for $thing {
|
||||
impl core::ops::Index<core::ops::RangeTo<usize>> for $thing {
|
||||
type Output = [$ty];
|
||||
|
||||
#[inline]
|
||||
fn index(&self, index: ::core::ops::RangeTo<usize>) -> &[$ty] {
|
||||
fn index(&self, index: core::ops::RangeTo<usize>) -> &[$ty] {
|
||||
let &$thing(ref dat) = self;
|
||||
&dat[index]
|
||||
}
|
||||
}
|
||||
|
||||
impl ::core::ops::Index<::core::ops::RangeFrom<usize>> for $thing {
|
||||
impl core::ops::Index<core::ops::RangeFrom<usize>> for $thing {
|
||||
type Output = [$ty];
|
||||
|
||||
#[inline]
|
||||
fn index(&self, index: ::core::ops::RangeFrom<usize>) -> &[$ty] {
|
||||
fn index(&self, index: core::ops::RangeFrom<usize>) -> &[$ty] {
|
||||
let &$thing(ref dat) = self;
|
||||
&dat[index]
|
||||
}
|
||||
}
|
||||
|
||||
impl ::core::ops::Index<::core::ops::RangeFull> for $thing {
|
||||
impl core::ops::Index<core::ops::RangeFull> for $thing {
|
||||
type Output = [$ty];
|
||||
|
||||
#[inline]
|
||||
fn index(&self, _: ::core::ops::RangeFull) -> &[$ty] {
|
||||
fn index(&self, _: core::ops::RangeFull) -> &[$ty] {
|
||||
let &$thing(ref dat) = self;
|
||||
&dat[..]
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ macro_rules! impl_array_newtype {
|
|||
type Target = $ty;
|
||||
fn as_c_ptr(&self) -> *const Self::Target {
|
||||
if self.is_empty() {
|
||||
::core::ptr::null()
|
||||
core::ptr::null()
|
||||
} else {
|
||||
self.as_ptr()
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ macro_rules! impl_array_newtype {
|
|||
|
||||
fn as_mut_c_ptr(&mut self) -> *mut Self::Target {
|
||||
if self.is_empty() {
|
||||
::core::ptr::null::<Self::Target>() as *mut _
|
||||
core::ptr::null::<Self::Target>() as *mut _
|
||||
} else {
|
||||
self.as_mut_ptr()
|
||||
}
|
||||
|
@ -162,8 +162,8 @@ macro_rules! impl_array_newtype {
|
|||
#[macro_export]
|
||||
macro_rules! impl_raw_debug {
|
||||
($thing:ident) => {
|
||||
impl ::core::fmt::Debug for $thing {
|
||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||
impl core::fmt::Debug for $thing {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||
for i in self[..].iter().cloned() {
|
||||
write!(f, "{:02x}", i)?;
|
||||
}
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
|
||||
//! # FFI of the recovery module
|
||||
|
||||
use ::types::*;
|
||||
use ::core::fmt;
|
||||
use {Context, Signature, NonceFn, PublicKey, CPtr};
|
||||
use crate::{Context, Signature, NonceFn, PublicKey, CPtr, impl_array_newtype};
|
||||
use crate::types::*;
|
||||
use core::fmt;
|
||||
|
||||
/// Library-internal representation of a Secp256k1 signature + recovery ID
|
||||
#[repr(C)]
|
||||
|
@ -98,13 +98,10 @@ extern "C" {
|
|||
|
||||
#[cfg(fuzzing)]
|
||||
mod fuzz_dummy {
|
||||
use super::*;
|
||||
use std::slice;
|
||||
use core::slice;
|
||||
|
||||
use secp256k1_ec_pubkey_create;
|
||||
use secp256k1_ec_pubkey_parse;
|
||||
use secp256k1_ec_pubkey_serialize;
|
||||
use SECP256K1_SER_COMPRESSED;
|
||||
use crate::{secp256k1_ec_pubkey_create, secp256k1_ec_pubkey_parse, secp256k1_ec_pubkey_serialize, SECP256K1_SER_COMPRESSED};
|
||||
use super::*;
|
||||
|
||||
/// Sets sig to msg32||full pk
|
||||
pub unsafe fn secp256k1_ecdsa_sign_recoverable(
|
||||
|
@ -170,6 +167,6 @@ mod fuzz_dummy {
|
|||
1
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(fuzzing)]
|
||||
pub use self::fuzz_dummy::*;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ mod tests {
|
|||
use std::any::TypeId;
|
||||
use std::mem;
|
||||
use std::os::raw;
|
||||
use {types, AlignedType};
|
||||
use crate::{types, AlignedType};
|
||||
|
||||
#[test]
|
||||
fn verify_types() {
|
||||
|
|
Loading…
Reference in New Issue