fix: use core instead of std - #741
Conversation
| use criterion::Criterion; | ||
| use hashbrown::DefaultHashBuilder; | ||
| use hashbrown::{HashMap, HashSet}; | ||
| use std::collections::hash_map::RandomState; |
There was a problem hiding this comment.
Actually, with our MSRV bump, this can be std::hash::RandomState
| /// | ||
| /// // Existing key (or_insert) | ||
| /// let v = map.entry("b").or_insert(2); | ||
| /// assert_eq!(std::mem::replace(v, 2), 20); |
There was a problem hiding this comment.
Mostly in favour of this change, but I would rather not update the doctests specifically since in general we prefer making those as simple as possible, and using only std allows better import grouping.
| use std::collections::BTreeSet; | ||
| use std::panic::catch_unwind; | ||
| use std::sync::Mutex; |
There was a problem hiding this comment.
Would brace-group these:
| use std::collections::BTreeSet; | |
| use std::panic::catch_unwind; | |
| use std::sync::Mutex; | |
| use std::{ | |
| collections::BTreeSet, | |
| panic::catch_unwind, | |
| sync::Mutex, | |
| }; |
There was a problem hiding this comment.
I had considered that, but rustfmt wanted to remove whitespace which I didn't like:
use std::{collections::BTreeSet, panic::catch_unwind, sync::Mutex};There was a problem hiding this comment.
I see; personally, I still would go with it, but it's up to you.
There was a problem hiding this comment.
In an ideal world, we'd use imports_layout = Vertical like libc but it's an unstable feature.
`std::collections::hash_map::RandomState` moved to `std::RandomState` in Rust 1.76.
89b0299 to
0119920
Compare
|
FWIW: there are clippy lints for |
No description provided.