Skip to content

Commit 993ee62

Browse files
committed
syle: minor aesthetic changes
1 parent 6d7d834 commit 993ee62

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/group_morphism.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,23 +171,20 @@ where
171171
/// The allocated elements are initially set to the identity.
172172
pub fn allocate_elements(&mut self, n: usize) -> Vec<PointVar> {
173173
let start = self.morphism.num_elements;
174-
let indices: Vec<usize> = (start..start + n).collect();
175-
176174
self.morphism
177175
.group_elements
178176
.extend(iter::repeat(G::identity()).take(n));
179-
let mut points = Vec::new();
180-
for i in indices.iter() {
181-
points.push(PointVar(*i));
182-
}
177+
let points = (start..start + n)
178+
.map(PointVar)
179+
.collect::<Vec<_>>();
183180
self.morphism.num_elements += n;
184181
points
185182
}
186183

187184
/// Set the value of group elements at a given index, inside the list of allocated group elements.
188185
pub fn set_elements(&mut self, elements: &[(PointVar, G)]) {
189-
for &(i, ref elt) in elements {
190-
self.morphism.group_elements[i.0] = *elt;
186+
for &(i, elt) in elements {
187+
self.morphism.group_elements[i.0] = elt;
191188
}
192189
}
193190

0 commit comments

Comments
 (0)