Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (27 sloc) 631 Bytes
// build-pass (FIXME(62277): could be check-pass?)
struct LoadedObject {
bodies: Vec<Body>,
color: Color,
}
struct Body;
#[derive(Clone)]
struct Color;
struct Graphic {
color: Color,
}
fn convert(objects: Vec<LoadedObject>) -> (Vec<Body>, Vec<Graphic>) {
objects
.into_iter()
.flat_map(|LoadedObject { bodies, color, .. }| {
bodies.into_iter().map(move |body| {
(
body,
Graphic {
color: color.clone(),
},
)
})
})
.unzip()
}
fn main() {}
You can’t perform that action at this time.