File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -203,12 +203,12 @@ pub fn derive(input: &Input) -> TokenStream {
203
203
}
204
204
205
205
206
- impl < ' a> std:: iter:: FromIterator <& ' a #name> for #vec_name {
207
- fn from_iter<T : IntoIterator <Item =& ' a #name>>( iter: T ) -> Self {
206
+ impl std:: iter:: FromIterator <#name> for #vec_name {
207
+ fn from_iter<T : IntoIterator <Item =#name>>( iter: T ) -> Self {
208
208
let mut result = #vec_name:: new( ) ;
209
209
for element in iter {
210
210
#(
211
- ( result. #fields_names) . push( element. #fields_names. clone ( ) ) ;
211
+ ( result. #fields_names) . push( element. #fields_names) ;
212
212
) *
213
213
}
214
214
result
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ fn from_iter() {
58
58
vec_with_particles. push ( Particle :: new ( String :: from ( "Cl" ) , 0.0 ) ) ;
59
59
vec_with_particles. push ( Particle :: new ( String :: from ( "Zn" ) , 0.0 ) ) ;
60
60
61
- let particles_from_iter: ParticleVec = vec_with_particles. iter ( ) . collect ( ) ;
61
+ let particles_from_iter: ParticleVec = vec_with_particles. into_iter ( ) . collect ( ) ;
62
62
63
63
let mut particles = ParticleVec :: new ( ) ;
64
64
particles. push ( Particle :: new ( String :: from ( "Na" ) , 0.0 ) ) ;
You can’t perform that action at this time.
0 commit comments