Skip to content

Commit

Permalink
Merge pull request #726 from mistydemeo/fix_typo
Browse files Browse the repository at this point in the history
docs: fix typo
  • Loading branch information
epage committed May 7, 2024
2 parents adbc75b + 1e3e033 commit f9249d8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion crates/toml_edit/src/array.rs
Expand Up @@ -132,7 +132,7 @@ impl Array {
self.values.len()
}

/// Return true iff `self.len() == 0`.
/// Return true if `self.len() == 0`.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion crates/toml_edit/src/array_of_tables.rs
Expand Up @@ -64,7 +64,7 @@ impl ArrayOfTables {
self.values.len()
}

/// Returns true iff `self.len() == 0`.
/// Returns true if `self.len() == 0`.
pub fn is_empty(&self) -> bool {
self.len() == 0
}
Expand Down
4 changes: 2 additions & 2 deletions crates/toml_edit/src/inline_table.rs
Expand Up @@ -263,7 +263,7 @@ impl InlineTable {
self.iter().count()
}

/// Returns true iff the table is empty.
/// Returns true if the table is empty.
pub fn is_empty(&self) -> bool {
self.len() == 0
}
Expand Down Expand Up @@ -354,7 +354,7 @@ impl InlineTable {
})
}

/// Returns true iff the table contains given key.
/// Returns true if the table contains given key.
pub fn contains_key(&self, key: &str) -> bool {
if let Some(kv) = self.items.get(key) {
kv.value.is_value()
Expand Down
26 changes: 13 additions & 13 deletions crates/toml_edit/src/item.rs
Expand Up @@ -21,7 +21,7 @@ pub enum Item {
}

impl Item {
/// Sets `self` to the given item iff `self` is none and
/// Sets `self` to the given item if `self` is none and
/// returns a mutable reference to `self`.
pub fn or_insert(&mut self, item: Item) -> &mut Item {
if self.is_none() {
Expand Down Expand Up @@ -177,19 +177,19 @@ impl Item {
};
*self = other;
}
/// Returns true iff `self` is a value.
/// Returns true if `self` is a value.
pub fn is_value(&self) -> bool {
self.as_value().is_some()
}
/// Returns true iff `self` is a table.
/// Returns true if `self` is a table.
pub fn is_table(&self) -> bool {
self.as_table().is_some()
}
/// Returns true iff `self` is an array of tables.
/// Returns true if `self` is an array of tables.
pub fn is_array_of_tables(&self) -> bool {
self.as_array_of_tables().is_some()
}
/// Returns true iff `self` is `None`.
/// Returns true if `self` is `None`.
pub fn is_none(&self) -> bool {
matches!(*self, Item::None)
}
Expand All @@ -201,7 +201,7 @@ impl Item {
self.as_value().and_then(Value::as_integer)
}

/// Returns true iff `self` is an integer.
/// Returns true if `self` is an integer.
pub fn is_integer(&self) -> bool {
self.as_integer().is_some()
}
Expand All @@ -211,7 +211,7 @@ impl Item {
self.as_value().and_then(Value::as_float)
}

/// Returns true iff `self` is a float.
/// Returns true if `self` is a float.
pub fn is_float(&self) -> bool {
self.as_float().is_some()
}
Expand All @@ -221,7 +221,7 @@ impl Item {
self.as_value().and_then(Value::as_bool)
}

/// Returns true iff `self` is a boolean.
/// Returns true if `self` is a boolean.
pub fn is_bool(&self) -> bool {
self.as_bool().is_some()
}
Expand All @@ -231,7 +231,7 @@ impl Item {
self.as_value().and_then(Value::as_str)
}

/// Returns true iff `self` is a string.
/// Returns true if `self` is a string.
pub fn is_str(&self) -> bool {
self.as_str().is_some()
}
Expand All @@ -241,7 +241,7 @@ impl Item {
self.as_value().and_then(Value::as_datetime)
}

/// Returns true iff `self` is a date-time.
/// Returns true if `self` is a date-time.
pub fn is_datetime(&self) -> bool {
self.as_datetime().is_some()
}
Expand All @@ -256,7 +256,7 @@ impl Item {
self.as_value_mut().and_then(Value::as_array_mut)
}

/// Returns true iff `self` is an array.
/// Returns true if `self` is an array.
pub fn is_array(&self) -> bool {
self.as_array().is_some()
}
Expand All @@ -271,7 +271,7 @@ impl Item {
self.as_value_mut().and_then(Value::as_inline_table_mut)
}

/// Returns true iff `self` is an inline table.
/// Returns true if `self` is an inline table.
pub fn is_inline_table(&self) -> bool {
self.as_inline_table().is_some()
}
Expand All @@ -292,7 +292,7 @@ impl Item {
}
}

/// Returns true iff `self` is either a table, or an inline table.
/// Returns true if `self` is either a table, or an inline table.
pub fn is_table_like(&self) -> bool {
self.as_table_like().is_some()
}
Expand Down
14 changes: 7 additions & 7 deletions crates/toml_edit/src/value.rs
Expand Up @@ -49,7 +49,7 @@ impl Value {
}
}

/// Returns true iff `self` is a string.
/// Returns true if `self` is a string.
pub fn is_str(&self) -> bool {
self.as_str().is_some()
}
Expand All @@ -62,7 +62,7 @@ impl Value {
}
}

/// Returns true iff `self` is an integer.
/// Returns true if `self` is an integer.
pub fn is_integer(&self) -> bool {
self.as_integer().is_some()
}
Expand All @@ -75,7 +75,7 @@ impl Value {
}
}

/// Returns true iff `self` is a float.
/// Returns true if `self` is a float.
pub fn is_float(&self) -> bool {
self.as_float().is_some()
}
Expand All @@ -88,7 +88,7 @@ impl Value {
}
}

/// Returns true iff `self` is a boolean.
/// Returns true if `self` is a boolean.
pub fn is_bool(&self) -> bool {
self.as_bool().is_some()
}
Expand All @@ -101,7 +101,7 @@ impl Value {
}
}

/// Returns true iff `self` is a date-time.
/// Returns true if `self` is a date-time.
pub fn is_datetime(&self) -> bool {
self.as_datetime().is_some()
}
Expand All @@ -122,7 +122,7 @@ impl Value {
}
}

/// Returns true iff `self` is an array.
/// Returns true if `self` is an array.
pub fn is_array(&self) -> bool {
self.as_array().is_some()
}
Expand All @@ -143,7 +143,7 @@ impl Value {
}
}

/// Returns true iff `self` is an inline table.
/// Returns true if `self` is an inline table.
pub fn is_inline_table(&self) -> bool {
self.as_inline_table().is_some()
}
Expand Down

0 comments on commit f9249d8

Please sign in to comment.