Don't use an explicit temporary for cloning an array
This commit is contained in:
parent
7867de02e3
commit
6dff9d03d9
1 changed files with 1 additions and 2 deletions
|
@ -209,8 +209,7 @@ macro_rules! array_impl_clone {
|
|||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: Clone> Clone for [T; $n] {
|
||||
fn clone(&self) -> [T; $n] {
|
||||
let temp = [&self[$i], $(&self[$idx]),*];
|
||||
[temp[$i].clone(), $(temp[$idx].clone()),*]
|
||||
[self[$i-$i].clone(), $(self[$i-$idx].clone()),*]
|
||||
}
|
||||
}
|
||||
array_impl_clone!{$i, $($idx,)*}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue