Applies a flat_map on a Vec, and overwrites the vec with the result.
(v: &mut Vec<T>, f: F)
| 196 | |
| 197 | /// Applies a flat_map on a Vec, and overwrites the vec with the result. |
| 198 | fn flat_map_modify<T, I, F>(v: &mut Vec<T>, f: F) |
| 199 | where |
| 200 | F: FnMut(T) -> I, |
| 201 | I: IntoIterator<Item = T>, |
| 202 | { |
| 203 | let mut xx = v.drain(..).flat_map(f).collect(); |
| 204 | v.append(&mut xx); |
| 205 | } |
| 206 | |
| 207 | /// Canonicalize predicates of a filter. |
| 208 | /// |
no test coverage detected