From 3ba4d632447398bcb6f0b65b2ec71339a7858814 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 14 Aug 2023 13:18:02 -0500 Subject: [PATCH] docs: Fix typos --- crates/toml_edit/CHANGELOG.md | 4 ++-- crates/toml_edit/src/de/value.rs | 2 +- crates/toml_edit/src/encode.rs | 34 +++++++++++++-------------- crates/toml_edit/src/parser/errors.rs | 2 +- crates/toml_edit/src/parser/mod.rs | 4 ++-- crates/toml_edit/src/parser/state.rs | 4 ++-- crates/toml_edit/src/ser/mod.rs | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/crates/toml_edit/CHANGELOG.md b/crates/toml_edit/CHANGELOG.md index 20eb1768..bbfc5e27 100644 --- a/crates/toml_edit/CHANGELOG.md +++ b/crates/toml_edit/CHANGELOG.md @@ -124,7 +124,7 @@ Breaking changes - Renamed `toml_edit::ser::Serializer` in favor of `toml_edit::ser::ValueSerializer` - Make `Key` only comparable by the value, not repr or decor - More consistently accept `InternalString` -- `Repr`, `Decor`, and `Formatted` are no longer guarenteed to hold strings for easy comparison / evaluatoon +- `Repr`, `Decor`, and `Formatted` are no longer guaranteed to hold strings for easy comparison / evaluatoon - `Key`, `KeyMut`, `Formatted` no longer have `to_repr`, replaced by `display_repr`, see also `as_repr`, `default_repr` Deprecations @@ -176,7 +176,7 @@ Deprecations ### Fixes -- Prevent stackoverflows with a recusion limit. Disable with `unbounded` feature flag +- Prevent stackoverflows with a recursion limit. Disable with `unbounded` feature flag ## [0.16.0] - 2022-12-23 diff --git a/crates/toml_edit/src/de/value.rs b/crates/toml_edit/src/de/value.rs index 39842875..d3cf87fc 100644 --- a/crates/toml_edit/src/de/value.rs +++ b/crates/toml_edit/src/de/value.rs @@ -5,7 +5,7 @@ use crate::de::Error; /// Deserialization implementation for TOML [values][crate::Value]. /// -/// Can be creater either directly from TOML strings, using [`std::str::FromStr`], +/// Can be created either directly from TOML strings, using [`std::str::FromStr`], /// or from parsed [values][crate::Value] using [`serde::de::IntoDeserializer::into_deserializer`]. /// /// # Example diff --git a/crates/toml_edit/src/encode.rs b/crates/toml_edit/src/encode.rs index 9940f282..3e984485 100644 --- a/crates/toml_edit/src/encode.rs +++ b/crates/toml_edit/src/encode.rs @@ -390,7 +390,7 @@ pub(crate) fn to_string_repr( '\u{8}' => output.push_str("\\b"), '\u{9}' => output.push_str("\\t"), '\u{a}' => match style { - StringStyle::NewlineTripple => output.push('\n'), + StringStyle::NewlineTriple => output.push('\n'), StringStyle::OnelineSingle => output.push_str("\\n"), _ => unreachable!(), }, @@ -412,44 +412,44 @@ pub(crate) fn to_string_repr( #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub(crate) enum StringStyle { - NewlineTripple, - OnelineTripple, + NewlineTriple, + OnelineTriple, OnelineSingle, } impl StringStyle { fn literal_start(self) -> &'static str { match self { - Self::NewlineTripple => "'''\n", - Self::OnelineTripple => "'''", + Self::NewlineTriple => "'''\n", + Self::OnelineTriple => "'''", Self::OnelineSingle => "'", } } fn literal_end(self) -> &'static str { match self { - Self::NewlineTripple => "'''", - Self::OnelineTripple => "'''", + Self::NewlineTriple => "'''", + Self::OnelineTriple => "'''", Self::OnelineSingle => "'", } } fn standard_start(self) -> &'static str { match self { - Self::NewlineTripple => "\"\"\"\n", - // note: OnelineTripple can happen if do_pretty wants to do + Self::NewlineTriple => "\"\"\"\n", + // note: OnelineTriple can happen if do_pretty wants to do // '''it's one line''' // but literal == false - Self::OnelineTripple | Self::OnelineSingle => "\"", + Self::OnelineTriple | Self::OnelineSingle => "\"", } } fn standard_end(self) -> &'static str { match self { - Self::NewlineTripple => "\"\"\"", - // note: OnelineTripple can happen if do_pretty wants to do + Self::NewlineTriple => "\"\"\"", + // note: OnelineTriple can happen if do_pretty wants to do // '''it's one line''' // but literal == false - Self::OnelineTripple | Self::OnelineSingle => "\"", + Self::OnelineTriple | Self::OnelineSingle => "\"", } } } @@ -490,7 +490,7 @@ fn infer_style(value: &str) -> (StringStyle, bool) { '\\' => { prefer_literal = true; } - '\n' => ty = StringStyle::NewlineTripple, + '\n' => ty = StringStyle::NewlineTriple, // Escape codes are needed if any ascii control // characters are present, including \b \f \r. c if c <= '\u{1f}' || c == '\u{7f}' => can_be_pretty = false, @@ -501,7 +501,7 @@ fn infer_style(value: &str) -> (StringStyle, bool) { // the string cannot be represented as pretty, // still check if it should be multiline if ch == '\n' { - ty = StringStyle::NewlineTripple; + ty = StringStyle::NewlineTriple; } } } @@ -513,7 +513,7 @@ fn infer_style(value: &str) -> (StringStyle, bool) { can_be_pretty = false; } if !can_be_pretty { - debug_assert!(ty != StringStyle::OnelineTripple); + debug_assert!(ty != StringStyle::OnelineTriple); return (ty, false); } if found_singles > max_found_singles { @@ -522,7 +522,7 @@ fn infer_style(value: &str) -> (StringStyle, bool) { debug_assert!(max_found_singles < 3); if ty == StringStyle::OnelineSingle && max_found_singles >= 1 { // no newlines, but must use ''' because it has ' in it - ty = StringStyle::OnelineTripple; + ty = StringStyle::OnelineTriple; } (ty, true) } diff --git a/crates/toml_edit/src/parser/errors.rs b/crates/toml_edit/src/parser/errors.rs index 859ed533..96ad8863 100644 --- a/crates/toml_edit/src/parser/errors.rs +++ b/crates/toml_edit/src/parser/errors.rs @@ -310,7 +310,7 @@ impl Display for CustomError { ) } CustomError::OutOfRange => write!(f, "value is out of range"), - CustomError::RecursionLimitExceeded => write!(f, "recursion limit exceded"), + CustomError::RecursionLimitExceeded => write!(f, "recursion limit exceeded"), } } } diff --git a/crates/toml_edit/src/parser/mod.rs b/crates/toml_edit/src/parser/mod.rs index 1b3cc4f0..eb475505 100644 --- a/crates/toml_edit/src/parser/mod.rs +++ b/crates/toml_edit/src/parser/mod.rs @@ -182,10 +182,10 @@ hosts = [ "omega" ] - 'some.wierd .stuff' = """ + 'some.weird .stuff' = """ like that - # """ # this broke my sintax highlighting + # """ # this broke my syntax highlighting " also. like " = ''' that ''' diff --git a/crates/toml_edit/src/parser/state.rs b/crates/toml_edit/src/parser/state.rs index efa884d2..b30ee3fa 100644 --- a/crates/toml_edit/src/parser/state.rs +++ b/crates/toml_edit/src/parser/state.rs @@ -94,7 +94,7 @@ impl ParseState { Ok(()) } - pub(crate) fn start_aray_table( + pub(crate) fn start_array_table( &mut self, path: Vec, decor: Decor, @@ -297,7 +297,7 @@ impl ParseState { .take() .map(RawString::with_span) .unwrap_or_default(); - self.start_aray_table( + self.start_array_table( path, Decor::new(leading, RawString::with_span(trailing)), span, diff --git a/crates/toml_edit/src/ser/mod.rs b/crates/toml_edit/src/ser/mod.rs index 2c310206..7f999302 100644 --- a/crates/toml_edit/src/ser/mod.rs +++ b/crates/toml_edit/src/ser/mod.rs @@ -24,7 +24,7 @@ pub enum Error { OutOfRange(Option<&'static str>), /// `None` could not be serialized to TOML UnsupportedNone, - /// Key was not convertable to `String` for serializing to TOML + /// Key was not convertible to `String` for serializing to TOML KeyNotString, /// A serialized date was invalid DateInvalid,