Skip to content

Instantly share code, notes, and snippets.

@djmcgill
Created November 13, 2016 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djmcgill/a7b6d3cb65b0548ee163b55a363d7cd4 to your computer and use it in GitHub Desktop.
Save djmcgill/a7b6d3cb65b0548ee163b55a363d7cd4 to your computer and use it in GitHub Desktop.
//// WORKS:
let mut octants: SubOctants = SVO::new_octants(|i| SVO::new_voxel(VoxelData::new(1)));
for ix in 0..8 {
let result: SVO = try!{ self.read_svo_from() };
mem::replace(&mut octants[ix as usize], Box::new(result));
}
Ok(SVO::Octants(octants))
//// ERROR: expected enum `svo::SVO`, found enum `std::result::Result`
let svo: SVO = SVO::new_octants(|i| {
let result: SVO = try!{ self.read_svo_from() };
result
});
Ok(svo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment