Skip to content

Commit

Permalink
delegate for get_mut too
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed May 20, 2024
1 parent dd51a1b commit 902841a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hugr/src/types/type_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = &'a Type>) -> Self {
self.iter().chain(rest).cloned().collect_vec().into()
Expand Down Expand Up @@ -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>;
}
}
}

Expand Down

0 comments on commit 902841a

Please sign in to comment.