Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 9b2d979

Browse files
committed
cargo fmt
1 parent 61d1511 commit 9b2d979

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

tests/json-sysctl/src/lib.rs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#![no_std]
22
#![feature(const_str_as_bytes)]
33

4-
use core::sync::atomic::{AtomicBool, Ordering};
54
use core::convert::TryInto;
5+
use core::sync::atomic::{AtomicBool, Ordering};
66

77
use serde::Serialize;
88
use serde_json_core;
99

10+
use linux_kernel_module::error;
1011
use linux_kernel_module::sysctl::Sysctl;
1112
use linux_kernel_module::Mode;
12-
use linux_kernel_module::error;
1313

1414
static A: AtomicBool = AtomicBool::new(false);
1515
static B: AtomicBool = AtomicBool::new(false);
@@ -35,7 +35,8 @@ impl linux_kernel_module::chrdev::FileOperations for JsonChrdev {
3535
b: B.load(Ordering::Relaxed),
3636
c: C.load(Ordering::Relaxed),
3737
};
38-
let mut s = serde_json_core::to_string::<typenum::U32, _>(&o).map_err(|_| error::Error::ENOMEM)?;
38+
let mut s =
39+
serde_json_core::to_string::<typenum::U32, _>(&o).map_err(|_| error::Error::ENOMEM)?;
3940
s.push_str("\n").map_err(|_| error::Error::ENOMEM)?;
4041
buf.write(&s.into_bytes()[offset.try_into()?..][..buf.len()])?;
4142
Ok(())
@@ -62,24 +63,9 @@ impl linux_kernel_module::KernelModule for JsonSysctlModule {
6263
.register_device::<JsonChrdev>()
6364
.build()?;
6465
Ok(JsonSysctlModule {
65-
_a: Sysctl::register(
66-
"json-sysctl\x00",
67-
"a\x00",
68-
&A,
69-
Mode::from_int(0o666),
70-
)?,
71-
_b: Sysctl::register(
72-
"json-sysctl\x00",
73-
"b\x00",
74-
&B,
75-
Mode::from_int(0o666),
76-
)?,
77-
_c: Sysctl::register(
78-
"json-sysctl\x00",
79-
"c\x00",
80-
&C,
81-
Mode::from_int(0o666),
82-
)?,
66+
_a: Sysctl::register("json-sysctl\x00", "a\x00", &A, Mode::from_int(0o666))?,
67+
_b: Sysctl::register("json-sysctl\x00", "b\x00", &B, Mode::from_int(0o666))?,
68+
_c: Sysctl::register("json-sysctl\x00", "c\x00", &C, Mode::from_int(0o666))?,
8369
_chrdev_registration: chrdev_registration,
8470
})
8571
}

0 commit comments

Comments
 (0)