Skip to content

Commit d162a5e

Browse files
authored
Merge pull request #562 from pitdicker/wasm-bindgen-0.2.12
Update to wasm-bindgen 0.2.12
2 parents 0159528 + 379ee2e commit d162a5e

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fuchsia-zircon = { version = "0.3.2", optional = true }
5252
[target.wasm32-unknown-unknown.dependencies]
5353
# use with `--target wasm32-unknown-unknown --features=stdweb`
5454
stdweb = { version = "0.4", optional = true }
55-
wasm-bindgen = { version = "0.2", optional = true }
55+
wasm-bindgen = { version = "0.2.12", optional = true }
5656

5757
[dev-dependencies]
5858
# This is for testing serde, unfortunately we can't specify feature-gated dev

src/lib.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@
232232
#![cfg_attr(feature = "stdweb", recursion_limit="128")]
233233
#![cfg_attr(feature = "wasm-bindgen", feature(use_extern_macros))]
234234
#![cfg_attr(feature = "wasm-bindgen", feature(wasm_import_module))]
235-
#![cfg_attr(feature = "wasm-bindgen", feature(wasm_custom_section))]
236235

237236
#[cfg(feature="std")] extern crate std as core;
238237
#[cfg(all(feature = "alloc", not(feature="std")))] extern crate alloc;
@@ -911,6 +910,7 @@ pub mod __wbg_shims {
911910
#[wasm_bindgen(method, getter, structural)]
912911
pub fn crypto(me: &This) -> JsValue;
913912

913+
#[derive(Clone, Debug)]
914914
pub type BrowserCrypto;
915915

916916
// TODO: these `structural` annotations here ideally wouldn't be here to
@@ -924,24 +924,12 @@ pub mod __wbg_shims {
924924
#[wasm_bindgen(js_name = require)]
925925
pub fn node_require(s: &str) -> NodeCrypto;
926926

927+
#[derive(Clone, Debug)]
927928
pub type NodeCrypto;
928929

929930
#[wasm_bindgen(method, js_name = randomFillSync, structural)]
930931
pub fn random_fill_sync(me: &NodeCrypto, buf: &mut [u8]);
931932
}
932-
933-
// TODO: replace with derive once rustwasm/wasm-bindgen#400 is merged
934-
impl Clone for BrowserCrypto {
935-
fn clone(&self) -> BrowserCrypto {
936-
BrowserCrypto { obj: self.obj.clone() }
937-
}
938-
}
939-
940-
impl Clone for NodeCrypto {
941-
fn clone(&self) -> NodeCrypto {
942-
NodeCrypto { obj: self.obj.clone() }
943-
}
944-
}
945933
}
946934
}
947935

src/rngs/os.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,14 +1107,12 @@ mod imp {
11071107
not(feature = "stdweb"),
11081108
feature = "wasm-bindgen"))]
11091109
mod imp {
1110-
use core::fmt;
1111-
11121110
use __wbg_shims::*;
11131111

11141112
use {Error, ErrorKind};
11151113
use super::OsRngImpl;
11161114

1117-
#[derive(Clone)]
1115+
#[derive(Clone, Debug)]
11181116
pub enum OsRng {
11191117
Node(NodeCrypto),
11201118
Browser(BrowserCrypto),
@@ -1187,13 +1185,6 @@ mod imp {
11871185
}
11881186
}
11891187
}
1190-
1191-
// TODO: replace with derive once rustwasm/wasm-bindgen#399 is merged
1192-
impl fmt::Debug for OsRng {
1193-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1194-
f.debug_struct("OsRng").finish()
1195-
}
1196-
}
11971188
}
11981189

11991190

0 commit comments

Comments
 (0)