summaryrefslogtreecommitdiffstats
path: root/graphics/src/renderer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/src/renderer.rs')
-rw-r--r--graphics/src/renderer.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/graphics/src/renderer.rs b/graphics/src/renderer.rs
index b052c094..859ebc04 100644
--- a/graphics/src/renderer.rs
+++ b/graphics/src/renderer.rs
@@ -43,8 +43,11 @@ impl<B: Backend, T> Renderer<B, T> {
/// 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);
+ pub fn with_primitives<O>(
+ &mut self,
+ f: impl FnOnce(&mut B, &[Primitive]) -> O,
+ ) -> O {
+ f(&mut self.backend, &self.primitives)
}
}