fmt: Use consistent include style
This commit is contained in:
committed by
Joseph Richey
parent
138d903318
commit
74eca5e871
+1
-2
@@ -7,8 +7,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
//! Implementation for FreeBSD and NetBSD
|
||||
use crate::util_libc::sys_fill_exact;
|
||||
use crate::Error;
|
||||
use crate::{util_libc::sys_fill_exact, Error};
|
||||
use core::ptr;
|
||||
|
||||
fn kern_arnd(buf: &mut [u8]) -> libc::ssize_t {
|
||||
|
||||
+1
-2
@@ -5,8 +5,7 @@
|
||||
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
use core::fmt;
|
||||
use core::num::NonZeroU32;
|
||||
use core::{fmt, num::NonZeroU32};
|
||||
|
||||
/// A small and `no_std` compatible error type.
|
||||
///
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
// except according to those terms.
|
||||
|
||||
//! Implementation for Linux / Android
|
||||
use crate::util::LazyBool;
|
||||
use crate::util_libc::{last_os_error, sys_fill_exact};
|
||||
use crate::{use_file, Error};
|
||||
use crate::{
|
||||
util::LazyBool,
|
||||
util_libc::{last_os_error, sys_fill_exact},
|
||||
{use_file, Error},
|
||||
};
|
||||
|
||||
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
|
||||
static HAS_GETRANDOM: LazyBool = LazyBool::new();
|
||||
|
||||
+5
-2
@@ -7,8 +7,11 @@
|
||||
// except according to those terms.
|
||||
|
||||
//! Implementation for macOS
|
||||
use crate::util_libc::{last_os_error, Weak};
|
||||
use crate::{use_file, Error};
|
||||
use crate::{
|
||||
use_file,
|
||||
util_libc::{last_os_error, Weak},
|
||||
Error,
|
||||
};
|
||||
use core::mem;
|
||||
|
||||
type GetEntropyFn = unsafe extern "C" fn(*mut u8, libc::size_t) -> libc::c_int;
|
||||
|
||||
+1
-2
@@ -7,8 +7,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
//! Implementation for OpenBSD
|
||||
use crate::util_libc::last_os_error;
|
||||
use crate::Error;
|
||||
use crate::{util_libc::last_os_error, Error};
|
||||
|
||||
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
|
||||
for chunk in dest.chunks_mut(256) {
|
||||
|
||||
@@ -17,8 +17,11 @@
|
||||
//! To make sure we can compile on both Solaris and its derivatives, as well as
|
||||
//! function, we check for the existence of getrandom(2) in libc by calling
|
||||
//! libc::dlsym.
|
||||
use crate::util_libc::{sys_fill_exact, Weak};
|
||||
use crate::{use_file, Error};
|
||||
use crate::{
|
||||
use_file,
|
||||
util_libc::{sys_fill_exact, Weak},
|
||||
Error,
|
||||
};
|
||||
use core::mem;
|
||||
|
||||
#[cfg(target_os = "illumos")]
|
||||
|
||||
+9
-5
@@ -7,11 +7,15 @@
|
||||
// except according to those terms.
|
||||
|
||||
//! Implementations that just need to read from a file
|
||||
use crate::util::LazyUsize;
|
||||
use crate::util_libc::{open_readonly, sys_fill_exact};
|
||||
use crate::Error;
|
||||
use core::cell::UnsafeCell;
|
||||
use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
|
||||
use crate::{
|
||||
util::LazyUsize,
|
||||
util_libc::{open_readonly, sys_fill_exact},
|
||||
Error,
|
||||
};
|
||||
use core::{
|
||||
cell::UnsafeCell,
|
||||
sync::atomic::{AtomicUsize, Ordering::Relaxed},
|
||||
};
|
||||
|
||||
#[cfg(target_os = "redox")]
|
||||
const FILE_PATH: &str = "rand:\0";
|
||||
|
||||
+2
-4
@@ -6,10 +6,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
#![allow(dead_code)]
|
||||
use crate::util::LazyUsize;
|
||||
use crate::Error;
|
||||
use core::num::NonZeroU32;
|
||||
use core::ptr::NonNull;
|
||||
use crate::{util::LazyUsize, Error};
|
||||
use core::{num::NonZeroU32, ptr::NonNull};
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android"))] {
|
||||
|
||||
+1
-2
@@ -7,8 +7,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
//! Implementation for VxWorks
|
||||
use crate::util_libc::last_os_error;
|
||||
use crate::Error;
|
||||
use crate::{util_libc::last_os_error, Error};
|
||||
use core::sync::atomic::{AtomicBool, Ordering::Relaxed};
|
||||
|
||||
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
|
||||
|
||||
Reference in New Issue
Block a user