summaryrefslogtreecommitdiff
path: root/src/geom/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/geom/mod.rs')
-rw-r--r--src/geom/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/geom/mod.rs b/src/geom/mod.rs
index 25344f0e..6f48d7d9 100644
--- a/src/geom/mod.rs
+++ b/src/geom/mod.rs
@@ -45,4 +45,9 @@ pub trait Get<Index> {
/// Borrow the component for the specified index mutably.
fn get_mut(&mut self, index: Index) -> &mut Self::Component;
+
+ /// Convenience method for setting a component.
+ fn set(&mut self, index: Index, component: Self::Component) {
+ *self.get_mut(index) = component;
+ }
}