Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
wuaoxiang authored and Geal committed Oct 23, 2021
1 parent 0d65b54 commit 337c218
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This release was done thanks to the hard work of (by order of appearance in the

- lots of documentation fixes
- relax trait bounds
- workarounds for depenency issues with bitvec and memchr
- workarounds for dependency issues with bitvec and memchr

## 6.1.2 - 2021-02-15

Expand Down Expand Up @@ -245,7 +245,7 @@ containing example patterns.
- removed the deprecated `whitespace` module
- the default error type is now a struct (`nom::error::Error`) instead of a tuple
- the `FromExternalError` allows wrapping the error returned by the function in the `map_res` combinator
- renamed the `dbg!` macro to avoid conficts with `std::dbg!`
- renamed the `dbg!` macro to avoid conflicts with `std::dbg!`
- `separated_list` now allows empty elements


Expand All @@ -256,7 +256,7 @@ containing example patterns.
- `success`: returns a value without consuming the input
- `satisfy`: checks a predicate over the next character
- `eof` function combinator
- `consumed`: returnes the produced value and the consumed input
- `consumed`: returns the produced value and the consumed input
- `length_count` function combinator
- `into`: converts a parser's output and error values if `From` implementations are available
- `IResult::finish()`: converts a parser's result to `Result<(I, O), E>` by removing the distinction between `Error` and `Failure` and panicking on `Incomplete`
Expand Down Expand Up @@ -1124,7 +1124,7 @@ Considering the number of changes since the last release, this version can conta
## 0.3.11 - 2015-08-04

### Thanks
- @bluss for remarking that the crate included random junk lying non commited in my local repository
- @bluss for remarking that the crate included random junk lying non committed in my local repository

### Fixed
- cleanup of my local repository will ship less files in the crates, resulting in a smaller download
Expand Down Expand Up @@ -1187,7 +1187,7 @@ Considering the number of changes since the last release, this version can conta
### Added
- documentation for a few functions
- the consumer trait now requires the `failed(&self, error_code)` method in case of parsing error
- `named!` now handles thge alternative `named!(pub fun_name<OutputType>, ...)`
- `named!` now handles the alternative `named!(pub fun_name<OutputType>, ...)`

### Fixed
- `filter!` now returns the whole input if the filter function never returned false
Expand Down
4 changes: 2 additions & 2 deletions doc/error_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum Err<E> {

The result is either an `Ok((I, O))` containing the remaining input and the
parsed value, or an `Err(nom::Err<E>)` with `E` the error type.
`nom::Err<E>` is an enum because combinators can have diferent behaviours
`nom::Err<E>` is an enum because combinators can have different behaviours
depending on the value:
- `Error` is a normal parser error. If a child parser of the `alt` combinator returns `Error`, it will try another child parser
- `Failure` is an error from which we cannot recover: The `alt` combinator will not try other branches if a child parser returns `Failure`. This is used when we know we were in the right branch of `alt` and do not need to try other branches
Expand All @@ -36,7 +36,7 @@ let parser_result: IResult<I, O, E> = parser(input);
let result: Result<(I, O), E> = parser_result.finish();
```

If we used a borrowed type as input, like `&[u8]` ot `&str`, we might want to
If we used a borrowed type as input, like `&[u8]` or `&str`, we might want to
convert it to an owned type to transmit it somewhere, with the `to_owned()`
method:

Expand Down
2 changes: 1 addition & 1 deletion doc/upgrading_to_nom_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ list, we have functions that take other functions as arguments, and return
functions.

This technique has a lot of advantages over macros:
- No type inference issues, you can explicitely describe the error type in
- No type inference issues, you can explicitly describe the error type in
function definitions
- Nicer compilation errors: rustc can show you exactly what is missing when calling
a combinator, if you need to import new traits, etc.
Expand Down
2 changes: 1 addition & 1 deletion examples/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where
// a predicate. `parse_hex` here parses between 1 and 6 hexadecimal numerals.
let parse_hex = take_while_m_n(1, 6, |c: char| c.is_ascii_hexdigit());

// `preceeded` takes a prefix parser, and if it succeeds, returns the result
// `preceded` takes a prefix parser, and if it succeeds, returns the result
// of the body parser. In this case, it parses u{XXXX}.
let parse_delimited_hex = preceded(
char('u'),
Expand Down
8 changes: 4 additions & 4 deletions src/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mod test {
);
assert!(
output == CONSUMED,
"Parser `take_s` doens't return the string it consumed on success. Expected `{}`, got `{}`.",
"Parser `take_s` doesn't return the string it consumed on success. Expected `{}`, got `{}`.",
CONSUMED,
output
);
Expand Down Expand Up @@ -120,7 +120,7 @@ mod test {
assert!(
output == CONSUMED,
"Parser `take_until`\
doens't return the string it consumed on success. Expected `{}`, got `{}`.",
doesn't return the string it consumed on success. Expected `{}`, got `{}`.",
CONSUMED,
output
);
Expand Down Expand Up @@ -281,7 +281,7 @@ mod test {
);
assert!(
output == CONSUMED,
"Parser `is_not` doens't return the string it consumed on success. Expected `{}`, got `{}`.",
"Parser `is_not` doesn't return the string it consumed on success. Expected `{}`, got `{}`.",
CONSUMED,
output
);
Expand Down Expand Up @@ -432,7 +432,7 @@ mod test {
);
assert!(
output == CONSUMED,
"Parser `is_a` doens't return the string it consumed on success. Expected `{}`, got `{}`.",
"Parser `is_a` doesn't return the string it consumed on success. Expected `{}`, got `{}`.",
CONSUMED,
output
);
Expand Down
2 changes: 1 addition & 1 deletion src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ impl<'a> InputTakeAtPosition for &'a str {
}
}

/// Indicates wether a comparison was successful, an error, or
/// Indicates whether a comparison was successful, an error, or
/// if more data was needed
#[derive(Debug, PartialEq)]
pub enum CompareResult {
Expand Down

0 comments on commit 337c218

Please sign in to comment.