summaryrefslogtreecommitdiff
path: root/src/geom
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-17 14:32:24 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-17 14:32:24 +0200
commit2e87808cdd986dfd91dbbc63fddf74c5b19b2afe (patch)
tree2f71fb22f76233a8b1c64991212c200988e92abe /src/geom
parente14e8047890afad5896c9f38ccdd8551f869be64 (diff)
Setter method
Diffstat (limited to 'src/geom')
-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;
+ }
}