Skip to content

Commit 8e61874

Browse files
authored
Merge pull request #275 from gregdhill/master
use core instead of std for wasm sanity checks
2 parents a24e27e + c86808f commit 8e61874

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

secp256k1-sys/src/types.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ pub type c_char = i8;
1616
/// We can replace this with `core::ffi::c_void` once we update the rustc version to >=1.30.0.
1717
#[repr(u8)]
1818
pub enum c_void {
19-
#[doc(hidden)] __variant1,
20-
#[doc(hidden)] __variant2,
19+
#[doc(hidden)]
20+
__variant1,
21+
#[doc(hidden)]
22+
__variant2,
2123
}
2224

2325
impl fmt::Debug for c_void {
@@ -43,13 +45,12 @@ impl AlignedType {
4345
#[cfg(all(feature = "std", not(rust_secp_no_symbol_renaming)))]
4446
pub(crate) const ALIGN_TO: usize = mem::align_of::<AlignedType>();
4547

46-
4748
#[cfg(test)]
4849
mod tests {
4950
extern crate libc;
50-
use std::os::raw;
51-
use std::mem;
5251
use std::any::TypeId;
52+
use std::mem;
53+
use std::os::raw;
5354
use {types, AlignedType};
5455

5556
#[test]
@@ -63,11 +64,10 @@ mod tests {
6364
}
6465
}
6566

66-
6767
#[doc(hidden)]
6868
#[cfg(target_arch = "wasm32")]
6969
pub fn sanity_checks_for_wasm() {
70-
use std::mem::{size_of, align_of};
70+
use core::mem::{align_of, size_of};
7171
extern "C" {
7272
pub static WASM32_INT_SIZE: c_uchar;
7373
pub static WASM32_INT_ALIGN: c_uchar;

0 commit comments

Comments
 (0)