extend-fn 1.0.0

Use arbitrary FnMut when something that must implement Extend is needed
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# extend-fn
Simple `no-alloc` library that allows using any arbitrary [`FnMut`][fn-mut] that takes a single value, in a place where types implementing [`Extend`][extend] are needed.

```rust
use extend_fn::ExtendUsing;

let initial = [3, 8, 2usize];

let mut result = 0usize;
let mut extender = ExtendUsing::new(|value: usize| result += value);
extender.extend(initial.iter().copied());

assert_eq!(result, initial.into_iter().sum());
```


[fn-mut]: https://doc.rust-lang.org/std/ops/trait.FnMut.html
[extend]: https://doc.rust-lang.org/std/iter/trait.Extend.html