Skip to content

Commit

Permalink
docs: Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 14, 2023
1 parent 5753e4f commit 3ba4d63
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions crates/toml_edit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion crates/toml_edit/src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions crates/toml_edit/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
},
Expand All @@ -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 => "\"",
}
}
}
Expand Down Expand Up @@ -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,
Expand All @@ -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;
}
}
}
Expand All @@ -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 {
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/toml_edit/src/parser/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
}
4 changes: 2 additions & 2 deletions crates/toml_edit/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
Expand Down
4 changes: 2 additions & 2 deletions crates/toml_edit/src/parser/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl ParseState {
Ok(())
}

pub(crate) fn start_aray_table(
pub(crate) fn start_array_table(
&mut self,
path: Vec<Key>,
decor: Decor,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/toml_edit/src/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3ba4d63

Please sign in to comment.