Skip to content

Commit

Permalink
impl Default for InitializeOnce<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon committed Jun 4, 2024
1 parent a8bdc46 commit af20db6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util/rust_util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ impl<T> std::ops::Deref for InitializeOnce<T> {

unsafe impl<T> Sync for InitializeOnce<T> {}

impl<T> std::default::Default for InitializeOnce<T> {
fn default() -> Self {
Self::new()
}
}

/// This implements `std::array::from_fn` introduced in Rust 1.63.
/// We should replace this with the standard counterpart after bumping MSRV,
/// but we also need to evaluate whether it would use too much stack space (see code comments).
Expand Down

0 comments on commit af20db6

Please sign in to comment.