]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/windows/rand.rs
Format libstd/sys with rustfmt
[rust.git] / src / libstd / sys / windows / rand.rs
index 993831bec188698d85939205e5aa74a208323c62..87ea416bf675af590f119be2438c3d291c6ecb7e 100644 (file)
@@ -5,13 +5,10 @@
 #[cfg(not(target_vendor = "uwp"))]
 pub fn hashmap_random_keys() -> (u64, u64) {
     let mut v = (0, 0);
-    let ret = unsafe {
-        c::RtlGenRandom(&mut v as *mut _ as *mut u8,
-                        mem::size_of_val(&v) as c::ULONG)
-    };
+    let ret =
+        unsafe { c::RtlGenRandom(&mut v as *mut _ as *mut u8, mem::size_of_val(&v) as c::ULONG) };
     if ret == 0 {
-        panic!("couldn't generate random bytes: {}",
-               io::Error::last_os_error());
+        panic!("couldn't generate random bytes: {}", io::Error::last_os_error());
     }
     v
 }
@@ -22,13 +19,15 @@ pub fn hashmap_random_keys() -> (u64, u64) {
 
     let mut v = (0, 0);
     let ret = unsafe {
-        c::BCryptGenRandom(ptr::null_mut(), &mut v as *mut _ as *mut u8,
-                           mem::size_of_val(&v) as c::ULONG,
-                           c::BCRYPT_USE_SYSTEM_PREFERRED_RNG)
+        c::BCryptGenRandom(
+            ptr::null_mut(),
+            &mut v as *mut _ as *mut u8,
+            mem::size_of_val(&v) as c::ULONG,
+            c::BCRYPT_USE_SYSTEM_PREFERRED_RNG,
+        )
     };
     if ret != 0 {
-        panic!("couldn't generate random bytes: {}",
-               io::Error::last_os_error());
+        panic!("couldn't generate random bytes: {}", io::Error::last_os_error());
     }
-    return v
+    return v;
 }