Skip to content

Commit

Permalink
Impl ImplicitClone for arrays and ref arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton committed Nov 5, 2023
1 parent 8ad7a09 commit c281d34
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ impl_implicit_clone!(
(),
);

impl<const N: usize, T: ImplicitClone> ImplicitClone for [T; N] {}

macro_rules! impl_implicit_clone_for_tuple {
($($param:ident),+ $(,)?) => {
impl<$($param: ImplicitClone),+> ImplicitClone for ($($param,)+) {}
Expand Down Expand Up @@ -174,6 +176,19 @@ mod test {
bool,
usize, isize, char,
(),
[u8; 4],
&[u8],
);

macro_rules! test_all_with_value {
($($t:ty => $v:expr),* $(,)?) => {
$(host_library!($v);)*
};
}

#[rustfmt::skip]
test_all_with_value!(
&[u8; 4] => &[0, 1, 2, 3],
);
}

Expand Down

0 comments on commit c281d34

Please sign in to comment.