From 14c3ef0b7e3b171aeb0e16067a8b1c764dfeee52 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Thu, 12 Oct 2023 16:51:29 +0900 Subject: [PATCH] types: Add write_int() helper Signed-off-by: Hector Martin --- src/types.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/types.rs b/src/types.rs index d3d1cf0..e6a80e3 100644 --- a/src/types.rs +++ b/src/types.rs @@ -52,6 +52,13 @@ impl Elem { .get_integer(0) .expect(&format!("Could not read {}", self.elem_name)) } + + pub fn write_int(&mut self, card: &Ctl, value: i32) { + self.val + .set_integer(0, value) + .expect(&format!("Could not set {}", self.elem_name)); + helpers::write_ev(card, &mut self.val, &self.elem_name); + } } /**