Skip to content

Commit 6e2b4d4

Browse files
committed
Run cargo fmt
1 parent 7553832 commit 6e2b4d4

File tree

6 files changed

+84
-14
lines changed

6 files changed

+84
-14
lines changed

ledger_device_sdk/src/io.rs

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,23 @@ use ledger_secure_sdk_sys::*;
55

66
use crate::seph;
77

8-
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex", target_os = "apex_p"))]
8+
#[cfg(any(
9+
target_os = "nanox",
10+
target_os = "stax",
11+
target_os = "flex",
12+
target_os = "apex_p"
13+
))]
914
use crate::seph::ItcUxEvent;
1015

1116
use core::convert::{Infallible, TryFrom};
1217
use core::ops::{Index, IndexMut};
1318

14-
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex", target_os = "apex_p"))]
19+
#[cfg(any(
20+
target_os = "nanox",
21+
target_os = "stax",
22+
target_os = "flex",
23+
target_os = "apex_p"
24+
))]
1525
unsafe extern "C" {
1626
pub unsafe static mut G_ux_params: bolos_ux_params_t;
1727
}
@@ -185,7 +195,12 @@ impl Comm {
185195
// This is private. Users should call reply to set the satus word and
186196
// transmit the response.
187197
fn apdu_send(&mut self) {
188-
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl"))]
198+
#[cfg(any(
199+
target_os = "stax",
200+
target_os = "flex",
201+
target_os = "apex_p",
202+
feature = "nano_nbgl"
203+
))]
189204
{
190205
let mut buffer: [u8; 273] = [0; 273];
191206
let status = sys_seph::io_rx(&mut buffer, false);
@@ -364,7 +379,12 @@ impl Comm {
364379

365380
// TICKER EVENT
366381
seph::Events::TickerEvent => {
367-
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl"))]
382+
#[cfg(any(
383+
target_os = "stax",
384+
target_os = "flex",
385+
target_os = "apex_p",
386+
feature = "nano_nbgl"
387+
))]
368388
unsafe {
369389
ux_process_ticker_event();
370390
}
@@ -373,7 +393,12 @@ impl Comm {
373393

374394
// ITC EVENT
375395
seph::Events::ItcEvent => {
376-
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex", target_os = "apex_p"))]
396+
#[cfg(any(
397+
target_os = "nanox",
398+
target_os = "stax",
399+
target_os = "flex",
400+
target_os = "apex_p"
401+
))]
377402
match ItcUxEvent::from(seph_buffer[3]) {
378403
seph::ItcUxEvent::AskBlePairing => unsafe {
379404
G_ux_params.ux_id = BOLOS_UX_ASYNCHMODAL_PAIRING_REQUEST;
@@ -397,7 +422,12 @@ impl Comm {
397422
},
398423

399424
seph::ItcUxEvent::Redisplay => {
400-
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl"))]
425+
#[cfg(any(
426+
target_os = "stax",
427+
target_os = "flex",
428+
target_os = "apex_p",
429+
feature = "nano_nbgl"
430+
))]
401431
unsafe {
402432
nbgl_objAllowDrawing(true);
403433
nbgl_screenRedraw();
@@ -412,7 +442,12 @@ impl Comm {
412442

413443
// DEFAULT EVENT
414444
_ => {
415-
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl"))]
445+
#[cfg(any(
446+
target_os = "stax",
447+
target_os = "flex",
448+
target_os = "apex_p",
449+
feature = "nano_nbgl"
450+
))]
416451
unsafe {
417452
ux_process_default_event();
418453
}

ledger_device_sdk/src/lib.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ pub mod seph;
1919

2020
pub mod testing;
2121

22-
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl"))]
22+
#[cfg(any(
23+
target_os = "stax",
24+
target_os = "flex",
25+
target_os = "apex_p",
26+
feature = "nano_nbgl"
27+
))]
2328
pub mod nbgl;
24-
#[cfg(not(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl")))]
29+
#[cfg(not(any(
30+
target_os = "stax",
31+
target_os = "flex",
32+
target_os = "apex_p",
33+
feature = "nano_nbgl"
34+
)))]
2535
pub mod ui;
2636

2737
pub mod uxapp;

ledger_device_sdk/src/libcall/swap.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl"))]
1+
#[cfg(any(
2+
target_os = "stax",
3+
target_os = "flex",
4+
target_os = "apex_p",
5+
feature = "nano_nbgl"
6+
))]
27
use crate::nbgl::NbglSpinner;
38
use crate::testing::debug_print;
49
use ledger_secure_sdk_sys::{
@@ -298,7 +303,12 @@ pub fn sign_tx_params<const COIN_CONFIG_BUF_SIZE: usize, const ADDRESS_BUF_SIZE:
298303
c_boot_std();
299304
}
300305

301-
#[cfg(any(target_os = "stax", target_os = "flex", target_os = "apex_p", feature = "nano_nbgl"))]
306+
#[cfg(any(
307+
target_os = "stax",
308+
target_os = "flex",
309+
target_os = "apex_p",
310+
feature = "nano_nbgl"
311+
))]
302312
NbglSpinner::new().show("Signing");
303313

304314
create_tx_params

ledger_device_sdk/src/nvm.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@ macro_rules! atomic_storage {
186186

187187
#[cfg(target_os = "nanox")]
188188
atomic_storage!(256);
189-
#[cfg(any(target_os = "nanosplus", target_os = "stax", target_os = "flex", target_os = "apex_p"))]
189+
#[cfg(any(
190+
target_os = "nanosplus",
191+
target_os = "stax",
192+
target_os = "flex",
193+
target_os = "apex_p"
194+
))]
190195
atomic_storage!(512);
191196

192197
pub enum AtomicStorageElem {

ledger_device_sdk/src/seph.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ pub fn handle_event(_apdu_buffer: &mut [u8], spi_buffer: &[u8]) {
9393
let _len = u16::from_be_bytes([spi_buffer[1], spi_buffer[2]]);
9494
match Events::from(spi_buffer[0]) {
9595
Events::TickerEvent => {
96-
#[cfg(any(target_os = "apex_p", target_os = "stax", target_os = "flex", feature = "nano_nbgl"))]
96+
#[cfg(any(
97+
target_os = "apex_p",
98+
target_os = "stax",
99+
target_os = "flex",
100+
feature = "nano_nbgl"
101+
))]
97102
unsafe {
98103
ux_process_ticker_event();
99104
}

ledger_device_sdk/src/uxapp.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ impl UxEvent {
4242
Self::ValidatePIN as u8
4343
}
4444
Self::DelayLock => {
45-
#[cfg(any(target_os = "apex_p", target_os = "stax", target_os = "flex", feature = "nano_nbgl"))]
45+
#[cfg(any(
46+
target_os = "apex_p",
47+
target_os = "stax",
48+
target_os = "flex",
49+
feature = "nano_nbgl"
50+
))]
4651
{
4752
G_ux_params.u.lock_delay.delay_ms = 10000;
4853
}

0 commit comments

Comments
 (0)