Skip to content

Commit a259704

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 268822d + 1237aa5 commit a259704

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,15 @@
11461146
"contributions": [
11471147
"content"
11481148
]
1149+
},
1150+
{
1151+
"login": "Fointard",
1152+
"name": "Fointard",
1153+
"avatar_url": "https://avatars.githubusercontent.com/u/9333398?v=4",
1154+
"profile": "https://github.com/Fointard",
1155+
"contributions": [
1156+
"content"
1157+
]
11491158
}
11501159
],
11511160
"contributorsPerLine": 8,

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ authors.
164164
<td align="center"><a href="https://github.com/ragreenburg"><img src="https://avatars.githubusercontent.com/u/24358100?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ragreenburg</b></sub></a><br /><a href="#content-ragreenburg" title="Content">🖋</a></td>
165165
<td align="center"><a href="https://github.com/stevenfukase"><img src="https://avatars.githubusercontent.com/u/66785624?v=4?s=100" width="100px;" alt=""/><br /><sub><b>stevenfukase</b></sub></a><br /><a href="#content-stevenfukase" title="Content">🖋</a></td>
166166
<td align="center"><a href="https://github.com/J-S-Kim"><img src="https://avatars.githubusercontent.com/u/17569303?v=4?s=100" width="100px;" alt=""/><br /><sub><b>J-S-Kim</b></sub></a><br /><a href="#content-J-S-Kim" title="Content">🖋</a></td>
167+
<td align="center"><a href="https://github.com/Fointard"><img src="https://avatars.githubusercontent.com/u/9333398?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fointard</b></sub></a><br /><a href="#content-Fointard" title="Content">🖋</a></td>
167168
</tr>
168169
</table>
169170

exercises/conversions/using_as.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// I AM NOT DONE
99

1010
fn average(values: &[f64]) -> f64 {
11-
let total = values.iter().fold(0.0, |a, b| a + b);
11+
let total = values.iter().sum::<f64>();
1212
total / values.len()
1313
}
1414

exercises/standard_library_types/arc1.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ fn main() {
3232
for offset in 0..8 {
3333
let child_numbers = // TODO
3434
joinhandles.push(thread::spawn(move || {
35-
let mut i = offset;
36-
let mut sum = 0;
37-
while i < child_numbers.len() {
38-
sum += child_numbers[i];
39-
i += 8;
40-
}
35+
let sum: u32 = child_numbers.iter().filter(|n| *n % 8 == offset).sum();
4136
println!("Sum of offset {} is {}", offset, sum);
4237
}));
4338
}

0 commit comments

Comments
 (0)