rename to iter_operators_mut

This commit is contained in:
Ben Weinstein-Raun 2023-06-04 14:16:02 -07:00
parent 1646a070a9
commit 49b61ff359
2 changed files with 6 additions and 6 deletions

View File

@ -88,7 +88,7 @@ impl Node {
} }
/// Returns a mutable iterator over all operators in this tree. /// Returns a mutable iterator over all operators in this tree.
pub fn iter_operator_mut(&mut self) -> impl Iterator<Item = &mut Operator> { pub fn iter_operators_mut(&mut self) -> impl Iterator<Item = &mut Operator> {
OperatorIterMut::new(self) OperatorIterMut::new(self)
} }
} }

View File

@ -98,7 +98,7 @@ impl Node {
/// assert_eq!(iter.next(), None); /// assert_eq!(iter.next(), None);
/// ``` /// ```
pub fn iter_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> { pub fn iter_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> {
self.iter_operator_mut() self.iter_operators_mut()
.filter_map(|operator| match operator { .filter_map(|operator| match operator {
Operator::VariableIdentifierWrite { identifier } Operator::VariableIdentifierWrite { identifier }
| Operator::VariableIdentifierRead { identifier } | Operator::VariableIdentifierRead { identifier }
@ -153,7 +153,7 @@ impl Node {
/// assert_eq!(iter.next(), None); /// assert_eq!(iter.next(), None);
/// ``` /// ```
pub fn iter_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> { pub fn iter_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> {
self.iter_operator_mut() self.iter_operators_mut()
.filter_map(|operator| match operator { .filter_map(|operator| match operator {
Operator::VariableIdentifierWrite { identifier } Operator::VariableIdentifierWrite { identifier }
| Operator::VariableIdentifierRead { identifier } => Some(identifier), | Operator::VariableIdentifierRead { identifier } => Some(identifier),
@ -207,7 +207,7 @@ impl Node {
/// assert_eq!(iter.next(), None); /// assert_eq!(iter.next(), None);
/// ``` /// ```
pub fn iter_read_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> { pub fn iter_read_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> {
self.iter_operator_mut() self.iter_operators_mut()
.filter_map(|operator| match operator { .filter_map(|operator| match operator {
Operator::VariableIdentifierRead { identifier } => Some(identifier), Operator::VariableIdentifierRead { identifier } => Some(identifier),
_ => None, _ => None,
@ -258,7 +258,7 @@ impl Node {
/// assert_eq!(iter.next(), None); /// assert_eq!(iter.next(), None);
/// ``` /// ```
pub fn iter_write_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> { pub fn iter_write_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> {
self.iter_operator_mut() self.iter_operators_mut()
.filter_map(|operator| match operator { .filter_map(|operator| match operator {
Operator::VariableIdentifierWrite { identifier } => Some(identifier), Operator::VariableIdentifierWrite { identifier } => Some(identifier),
_ => None, _ => None,
@ -309,7 +309,7 @@ impl Node {
/// assert_eq!(iter.next(), None); /// assert_eq!(iter.next(), None);
/// ``` /// ```
pub fn iter_function_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> { pub fn iter_function_variable_identifiers_mut(&mut self) -> impl Iterator<Item = &mut String> {
self.iter_operator_mut() self.iter_operators_mut()
.filter_map(|operator| match operator { .filter_map(|operator| match operator {
Operator::FunctionIdentifier { identifier } => Some(identifier), Operator::FunctionIdentifier { identifier } => Some(identifier),
_ => None, _ => None,