Skip to content

Commit e4ce15a

Browse files
CGMossaLuthaf
authored andcommitted
Adjusting due to test failures
1 parent c1813a5 commit e4ce15a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

soa-derive-internal/src/iter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ pub fn derive(input: &Input) -> TokenStream {
203203
}
204204

205205

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 {
208208
let mut result = #vec_name::new();
209209
for element in iter {
210210
#(
211-
(result.#fields_names).push(element.#fields_names.clone());
211+
(result.#fields_names).push(element.#fields_names);
212212
)*
213213
}
214214
result

tests/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn from_iter() {
5858
vec_with_particles.push(Particle::new(String::from("Cl"), 0.0));
5959
vec_with_particles.push(Particle::new(String::from("Zn"), 0.0));
6060

61-
let particles_from_iter: ParticleVec = vec_with_particles.iter().collect();
61+
let particles_from_iter: ParticleVec = vec_with_particles.into_iter().collect();
6262

6363
let mut particles = ParticleVec::new();
6464
particles.push(Particle::new(String::from("Na"), 0.0));

0 commit comments

Comments
 (0)