Skip to content

Commit 74eca5e

Browse files
committed
fmt: Use consistent include style
1 parent 138d903 commit 74eca5e

9 files changed

+30
-24
lines changed

src/bsd_arandom.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
// except according to those terms.
88

99
//! Implementation for FreeBSD and NetBSD
10-
use crate::util_libc::sys_fill_exact;
11-
use crate::Error;
10+
use crate::{util_libc::sys_fill_exact, Error};
1211
use core::ptr;
1312

1413
fn kern_arnd(buf: &mut [u8]) -> libc::ssize_t {

src/error.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
8-
use core::fmt;
9-
use core::num::NonZeroU32;
8+
use core::{fmt, num::NonZeroU32};
109

1110
/// A small and `no_std` compatible error type.
1211
///

src/linux_android.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
// except according to those terms.
88

99
//! Implementation for Linux / Android
10-
use crate::util::LazyBool;
11-
use crate::util_libc::{last_os_error, sys_fill_exact};
12-
use crate::{use_file, Error};
10+
use crate::{
11+
util::LazyBool,
12+
util_libc::{last_os_error, sys_fill_exact},
13+
{use_file, Error},
14+
};
1315

1416
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
1517
static HAS_GETRANDOM: LazyBool = LazyBool::new();

src/macos.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
// except according to those terms.
88

99
//! Implementation for macOS
10-
use crate::util_libc::{last_os_error, Weak};
11-
use crate::{use_file, Error};
10+
use crate::{
11+
use_file,
12+
util_libc::{last_os_error, Weak},
13+
Error,
14+
};
1215
use core::mem;
1316

1417
type GetEntropyFn = unsafe extern "C" fn(*mut u8, libc::size_t) -> libc::c_int;

src/openbsd.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
// except according to those terms.
88

99
//! Implementation for OpenBSD
10-
use crate::util_libc::last_os_error;
11-
use crate::Error;
10+
use crate::{util_libc::last_os_error, Error};
1211

1312
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
1413
for chunk in dest.chunks_mut(256) {

src/solaris_illumos.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
//! To make sure we can compile on both Solaris and its derivatives, as well as
1818
//! function, we check for the existence of getrandom(2) in libc by calling
1919
//! libc::dlsym.
20-
use crate::util_libc::{sys_fill_exact, Weak};
21-
use crate::{use_file, Error};
20+
use crate::{
21+
use_file,
22+
util_libc::{sys_fill_exact, Weak},
23+
Error,
24+
};
2225
use core::mem;
2326

2427
#[cfg(target_os = "illumos")]

src/use_file.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77
// except according to those terms.
88

99
//! Implementations that just need to read from a file
10-
use crate::util::LazyUsize;
11-
use crate::util_libc::{open_readonly, sys_fill_exact};
12-
use crate::Error;
13-
use core::cell::UnsafeCell;
14-
use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
10+
use crate::{
11+
util::LazyUsize,
12+
util_libc::{open_readonly, sys_fill_exact},
13+
Error,
14+
};
15+
use core::{
16+
cell::UnsafeCell,
17+
sync::atomic::{AtomicUsize, Ordering::Relaxed},
18+
};
1519

1620
#[cfg(target_os = "redox")]
1721
const FILE_PATH: &str = "rand:\0";

src/util_libc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88
#![allow(dead_code)]
9-
use crate::util::LazyUsize;
10-
use crate::Error;
11-
use core::num::NonZeroU32;
12-
use core::ptr::NonNull;
9+
use crate::{util::LazyUsize, Error};
10+
use core::{num::NonZeroU32, ptr::NonNull};
1311

1412
cfg_if! {
1513
if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android"))] {

src/vxworks.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
// except according to those terms.
88

99
//! Implementation for VxWorks
10-
use crate::util_libc::last_os_error;
11-
use crate::Error;
10+
use crate::{util_libc::last_os_error, Error};
1211
use core::sync::atomic::{AtomicBool, Ordering::Relaxed};
1312

1413
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {

0 commit comments

Comments
 (0)