MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / flat_map_modify

Function flat_map_modify

src/expr/src/relation/canonicalize.rs:198–205  ·  view source on GitHub ↗

Applies a flat_map on a Vec, and overwrites the vec with the result.

(v: &mut Vec<T>, f: F)

Source from the content-addressed store, hash-verified

196
197/// Applies a flat_map on a Vec, and overwrites the vec with the result.
198fn flat_map_modify<T, I, F>(v: &mut Vec<T>, f: F)
199where
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///

Callers 1

canonicalize_predicatesFunction · 0.85

Calls 4

collectMethod · 0.45
flat_mapMethod · 0.45
drainMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected