Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
dba3fd5
first commit
oboulant Apr 24, 2025
2bc8f3c
saddle-points
oboulant Apr 28, 2025
81cc38f
use `flat_map()` instead of `map().flatten()`
oboulant Apr 28, 2025
506e564
say
oboulant May 2, 2025
f33fb79
correction after feedback
oboulant May 2, 2025
741ca1c
scrabble
oboulant May 7, 2025
517c0e7
sieve
oboulant May 12, 2025
ce53234
simple linked list
oboulant May 14, 2025
d89b095
spiral_matrix
oboulant May 17, 2025
9b79e90
tournament
oboulant May 20, 2025
f8ef18f
triangle
oboulant May 21, 2025
c1621d8
two-bucket
oboulant Jun 6, 2025
4528bcb
vlq
oboulant Jun 6, 2025
a53c884
Merge branch 'exercism:main' into main
oboulant Jun 10, 2025
9b08fe5
robot simulator
oboulant Jun 10, 2025
9d81344
Merge branch 'main' of https://github.com/oboulant/exercism-rust
oboulant Jun 10, 2025
5d7c10d
robot name
oboulant Jun 12, 2025
a49dabf
protein translation
oboulant Jun 12, 2025
a8e7fab
working without exponentials
oboulant Jun 13, 2025
3c0ba71
wordy
oboulant Jun 13, 2025
7e472d3
only locking when necessary on write and fix a bug on reset
oboulant Jun 17, 2025
83428d7
accumulate
oboulant Jun 23, 2025
402f312
custom-set
oboulant Jun 23, 2025
a5b42bd
affine-cipher
oboulant Jun 23, 2025
7fc387a
atbash-cipher
oboulant Jun 23, 2025
8cac6e6
crypto square
oboulant Jun 29, 2025
9cedeb7
diamond
oboulant Jun 29, 2025
520a8c5
largest-series-product
oboulant Jun 30, 2025
571b9e5
luhn-from
oboulant Jun 30, 2025
c40ddbc
luhn-trait
oboulant Jun 30, 2025
7356cdc
list-ops
oboulant Jul 3, 2025
7a6a132
phone-number
oboulant Jul 3, 2025
e52533a
using .first() to access first element
oboulant Jul 3, 2025
32a91f1
rail-fence-cipher
oboulant Jul 3, 2025
9d845b5
roman-numerals
oboulant Jul 3, 2025
5275025
correct string formating
oboulant Jul 3, 2025
2adc0d9
rotational-cipher
oboulant Jul 3, 2025
42bd28c
simple-cipher
oboulant Jul 8, 2025
42f2f49
fix some warnings
oboulant Jul 8, 2025
f305f99
Merge branch 'main' of https://github.com/exercism/rust into exercism…
oboulant Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
accumulate
  • Loading branch information
oboulant committed Jun 23, 2025
commit 83428d76fba77f894eb859961f64e9bd901e6655
12 changes: 10 additions & 2 deletions exercises/practice/accumulate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
/// What should the type of _function be?
pub fn map(input: Vec<i32>, _function: ???) -> Vec<i32> {
todo!("Transform input vector {input:?} using passed function");
pub fn map<T, U, F>(input: Vec<T>, mut _function: F ) -> Vec<U>
where
F: FnMut(T) -> U,
{
let mut res = Vec::new();

for el in input {
res.push(_function(el));
}
res
}