Skip to content

Commit

Permalink
Implement Default for ffi_safe::Vec
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Nov 18, 2022
1 parent f2eff7a commit ba93979
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/fj/src/abi/ffi_safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ impl<T: Copy> From<Vec<T>> for Box<[T]> {
}
}

impl<T> Default for Vec<T> {
fn default() -> Self {
std::vec::Vec::default().into()
}
}

impl<T> FromIterator<T> for Vec<T> {
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
let vec: std::vec::Vec<T> = iter.into_iter().collect();
Expand Down

0 comments on commit ba93979

Please sign in to comment.