mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 04:48:13 +00:00
prefer default over new
This commit is contained in:
parent
6ca780700d
commit
2462624a7d
46 changed files with 100 additions and 127 deletions
|
|
@ -177,7 +177,10 @@ pub struct InternStorage<T: ?Sized> {
|
|||
map: OnceLock<InternMap<T>>,
|
||||
}
|
||||
|
||||
#[allow(clippy::new_without_default)] // this a const fn, so it can't be default
|
||||
#[allow(
|
||||
clippy::new_without_default,
|
||||
reason = "this a const fn, so it can't be default yet. See <https://github.com/rust-lang/rust/issues/63065>"
|
||||
)]
|
||||
impl<T: ?Sized> InternStorage<T> {
|
||||
pub const fn new() -> Self {
|
||||
Self { map: OnceLock::new() }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue