pub fn serialize_paths_from_funcs<PathSrc, AdvanceF, PathF, W>(
target: &mut W,
src: &mut PathSrc,
advance_f: AdvanceF,
path_f: PathF,
) -> Result<SerializationStats>Expand description
Generates .paths data by invoking arbitrary closures
Warning: the size of the individual path serialization can be double exponential in the size of the PathMap
NOTE: This function takes two closures because of a limitation in the borrow checker.
borrowck isn’t smart enough to allow one closure to take a mutable borrow of the PathSrc
object, and return a const reborrow, and then allow the original mutable reference to
be used again after the reborrow was dropped. Doing the reborrow in the loop works around
this limitation.
When the borrow checker becomes more capable, we can try to collapse this function to take one closure instead of two.