mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
feat(data_structures): implement Default for NonEmptyStack (#7946)
Implement `Default` for `NonEmptyStack<T>` where `T: Default`.
This commit is contained in:
parent
ff2a68f22b
commit
46e2e27735
1 changed files with 6 additions and 0 deletions
|
|
@ -366,6 +366,12 @@ impl<T> DerefMut for NonEmptyStack<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Default> Default for NonEmptyStack<T> {
|
||||
fn default() -> Self {
|
||||
Self::new(T::default())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
|
|||
Loading…
Reference in a new issue