-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vastly improved support for deserialized iteration (#7024)
Whether we like it or not, sometimes we've got to deserialize. Up until now, the new APIs only provided a nice UX for the deserialization-free paths, while the deserialized path was particularly painful to use. The source of the pain is, as so often, the lack of lending iterators in the stdlib. This PR fixes that. Essentially, this: ```rust let all_fill_mode_chunks = results.get_optional_chunks(&FillMode::name()); let all_fill_modes = results.iter_as(timeline, FillMode::name()); let mut all_fill_mode_iters = all_fill_mode_chunks .iter() .map(|chunk| chunk.iter_component::<FillMode>()) .collect_vec(); let mut all_fill_modes_indexed = { let all_fill_modes = all_fill_mode_iters.iter_mut().flat_map(|it| it.into_iter()); let all_fill_modes_indices = all_fill_mode_chunks.iter().flat_map(|chunk| { chunk.iter_component_indices(&timeline, &FillMode::name()) }); itertools::izip!(all_fill_modes_indices, all_fill_modes) }; ``` becomes this: ```rust let all_fill_modes = results.iter_as(timeline, FillMode::name()).component::<FillMode>(); ```
- Loading branch information
Showing
14 changed files
with
164 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.