Skip to content

Commit 058a685

Browse files
committed
ci: fix dead code
beta toolchain discovered unused code.
1 parent 1aacb5d commit 058a685

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ features=(
1212
examples=(
1313
"--example singlethreaded --features=usb,tokio/rt,tokio/macros"
1414
"--example multithreaded --features=usb,tokio/rt,tokio/macros,tokio/rt-multi-thread,multithreaded"
15-
" --example btc_signtx --features=usb,tokio/rt,tokio/macros"
15+
"--example btc_signtx --features=usb,tokio/rt,tokio/macros"
1616
"--example btc_sign_psbt --features=usb,tokio/rt,tokio/macros"
1717
"--example btc_sign_msg --features=usb,tokio/rt,tokio/macros"
1818
"--example btc_miniscript --features=usb,tokio/rt,tokio/macros"

src/u2fframing.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ pub fn generate_cid() -> u32 {
8383

8484
// U2FWS (U2F WebSocket framing protocol) writes u2fhid header and payload as single package (up to
8585
// 7+7609 bytes)
86+
#[cfg(feature = "wasm")]
8687
pub struct U2fWs {
8788
cid: u32,
8889
cmd: u8,
8990
}
9091

92+
#[cfg(feature = "wasm")]
9193
impl U2fWs {
9294
pub fn new(cmd: u8) -> Self {
9395
U2fWs {
@@ -102,12 +104,14 @@ impl U2fWs {
102104
}
103105
}
104106

107+
#[cfg(feature = "wasm")]
105108
impl Default for U2fWs {
106109
fn default() -> Self {
107110
Self::new(0)
108111
}
109112
}
110113

114+
#[cfg(feature = "wasm")]
111115
impl U2FFraming for U2fWs {
112116
fn encode(&self, message: &[u8], mut buf: &mut [u8]) -> io::Result<usize> {
113117
let len = encode_header_init(self.cid, self.cmd, message.len() as u16, buf)?;
@@ -314,6 +318,7 @@ mod tests {
314318
assert_eq!(&data[..], &payload[..]);
315319
}
316320

321+
#[cfg(feature = "wasm")]
317322
#[test]
318323
fn test_u2fws_encode_single() {
319324
let codec = U2fWs::with_cid(0xEEEEEEEE, 0x55);
@@ -326,6 +331,7 @@ mod tests {
326331
);
327332
}
328333

334+
#[cfg(feature = "wasm")]
329335
#[test]
330336
fn test_u2fws_encode_multi() {
331337
let payload: Vec<u8> = (0..65u8).collect();
@@ -339,6 +345,7 @@ mod tests {
339345
assert_eq!(&data[..len], &expect[..]);
340346
}
341347

348+
#[cfg(feature = "wasm")]
342349
#[test]
343350
fn test_u2fws_decode_single() {
344351
let codec = U2fWs::with_cid(0xEEEEEEEE, 0x55);
@@ -349,6 +356,7 @@ mod tests {
349356
assert_eq!(&data[..], b"\x01\x02\x03\x04");
350357
}
351358

359+
#[cfg(feature = "wasm")]
352360
#[test]
353361
fn test_u2fws_decode_multi() {
354362
let payload: Vec<u8> = (0..65u8).collect();

0 commit comments

Comments
 (0)