diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2f580fb..ae062ba 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,19 +7,9 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
+
@@ -85,7 +75,7 @@
"org.rust.cargo.project.model.PROJECT_DISCOVERY": "true",
"org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "",
"org.rust.first.attach.projects": "true",
- "settings.editor.selected.configurable": "preferences.keymap",
+ "settings.editor.selected.configurable": "preferences.pluginManager",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
@@ -229,15 +219,8 @@
-
-
-
-
- 1714089790504
-
-
-
- 1714089790504
+
+
@@ -623,7 +606,15 @@
1721951605297
-
+
+
+ 1721954057479
+
+
+
+ 1721954057480
+
+
@@ -641,7 +632,6 @@
-
@@ -666,7 +656,8 @@
-
+
+
diff --git a/src/root/unrandom.rs b/src/root/unrandom.rs
index ebd54db..3e13f2d 100644
--- a/src/root/unrandom.rs
+++ b/src/root/unrandom.rs
@@ -1,5 +1,4 @@
use std::hash::RandomState;
-use std::{mem, ptr, slice};
use std::collections::{HashMap, HashSet};
#[inline]
@@ -16,19 +15,9 @@ pub fn new_hashmap() -> HashMap {
#[inline]
pub fn unrandom_hashmap() -> HashMap {
- let mut r = RandomState::new();
- let p: *mut RandomState = &mut r;
- let p: *mut u8 = p as *mut u8;
- let s: &mut [u8] = unsafe {
- slice::from_raw_parts_mut(p, mem::size_of::())
+ let r: RandomState = unsafe {
+ std::mem::transmute([0u8; size_of::()])
};
- unsafe {
- for s in &mut *s {
- let p: *const u8 = s;
- let p: *mut u8 = p as *mut u8;
- ptr::write_volatile(p, 0u8);
- }
- }
HashMap::with_hasher(r)
}
@@ -47,19 +36,9 @@ pub fn new_hashset() -> HashSet {
#[inline]
pub fn unrandom_hashset() -> HashSet {
- let mut r = RandomState::new();
- let p: *mut RandomState = &mut r;
- let p: *mut u8 = p as *mut u8;
- let s: &mut [u8] = unsafe {
- slice::from_raw_parts_mut(p, mem::size_of::())
+ let r: RandomState = unsafe {
+ std::mem::transmute([0u8; size_of::()])
};
- unsafe {
- for s in &mut *s {
- let p: *const u8 = s;
- let p: *mut u8 = p as *mut u8;
- ptr::write_volatile(p, 0u8);
- }
- }
HashSet::with_hasher(r)
}
\ No newline at end of file