From 902841aae704c8f95d7aadb901c4e0cd4e8d2f34 Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Mon, 20 May 2024 16:51:08 +0100 Subject: [PATCH] delegate for get_mut too --- hugr/src/types/type_row.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hugr/src/types/type_row.rs b/hugr/src/types/type_row.rs index 689df0642..3d97a8068 100644 --- a/hugr/src/types/type_row.rs +++ b/hugr/src/types/type_row.rs @@ -37,12 +37,6 @@ impl TypeRow { } } - #[inline(always)] - /// Returns the type at the specified index. Returns `None` if out of bounds. - pub fn get_mut(&mut self, offset: usize) -> Option<&mut Type> { - self.types.to_mut().get_mut(offset) - } - /// Returns a new `TypeRow` with `xs` concatenated onto `self`. pub fn extend<'a>(&'a self, rest: impl IntoIterator) -> Self { self.iter().chain(rest).cloned().collect_vec().into() @@ -74,6 +68,12 @@ impl TypeRow { /// Returns the type at the specified index. Returns `None` if out of bounds. pub fn get(&self, offset: usize) -> Option<&Type>; } + + to self.types.to_mut() { + #[inline(always)] + /// Returns the type at the specified index. Returns `None` if out of bounds. + pub fn get_mut(&mut self, offset: usize) -> Option<&mut Type>; + } } }