Rename Renderer::present to with_primitives

This commit is contained in:
Héctor Ramón Jiménez 2021-11-05 15:38:27 +07:00
parent aca9d414d3
commit 9fe65ed729
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 8 additions and 6 deletions

View file

@ -31,7 +31,9 @@ impl<B: Backend> Renderer<B> {
self.primitives.push(primitive);
}
pub fn present(&mut self, f: impl FnOnce(&mut B, &[Primitive])) {
/// Runs the given closure with the [`Backend`] and the recorded primitives
/// of the [`Renderer`].
pub fn with_primitives(&mut self, f: impl FnOnce(&mut B, &[Primitive])) {
f(&mut self.backend, &self.primitives);
}
}