Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
pymongo committed Jun 21, 2023
1 parent 1fb07f1 commit 294773a
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion impl/doc/as_mut.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl AsMut<String> for MyWrapper {
```

It's also possible to use the `#[as_mut(forward)]` attribute to forward
to the `as_mut` implementation of the field. So here `SigleFieldForward`
to the `as_mut` implementation of the field. So here `SingleFieldForward`
implements all `AsMut` for all types that `Vec<i32>` implements `AsMut` for.

```rust
Expand Down
2 changes: 1 addition & 1 deletion impl/doc/as_ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl AsRef<String> for MyWrapper {
```

It's also possible to use the `#[as_ref(forward)]` attribute to forward
to the `as_ref` implementation of the field. So here `SigleFieldForward`
to the `as_ref` implementation of the field. So here `SingleFieldForward`
implements all `AsRef` for all types that `Vec<i32>` implements `AsRef` for.

```rust
Expand Down
2 changes: 1 addition & 1 deletion impl/doc/debug.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# What `#[derive(Debug)]` generates

This derive macro is a clever superset of `Debug` from standard library. Additional features include:
- not imposing redudant trait bounds;
- not imposing redundant trait bounds;
- `#[debug(skip)]` attribute to skip formatting struct field or enum variant;
- `#[debug("...", args...)]` to specify custom formatting for a particular struct or enum variant field;
- `#[debug(bounds(...))]` to impose additional custom trait bounds.
Expand Down
2 changes: 1 addition & 1 deletion impl/doc/into.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# What `#[derive(Into)]` generates

This derive creates the the exact oposite of [`#[derive(From)]`](crate::From).
This derive creates the the exact opposite of [`#[derive(From)]`](crate::From).
Instead of allowing you to create a new instance of the struct from the values
it should contain, it allows you to extract the values from the struct.
One thing to note is that this derive doesn't actually generate an
Expand Down
2 changes: 1 addition & 1 deletion impl/src/add_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn enum_content(
matches.push(matcher);
}
Fields::Named(ref fields) => {
// The patern that is outputted should look like this:
// The pattern that is outputted should look like this:
// (Subtype{a: __l_a, ...}, Subtype{a: __r_a, ...} => {
// Ok(Subtype{a: __l_a.add(__r_a), ...})
// }
Expand Down
2 changes: 1 addition & 1 deletion impl/src/from_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn enum_from(

let mut cases = vec![];

// if a case insensitve match is unique match do that
// if a case insensitive match is unique match do that
// otherwise do a case sensitive match
for (ref canonical, ref variants) in variants_caseinsensitive {
if variants.len() == 1 {
Expand Down
4 changes: 2 additions & 2 deletions impl/src/not_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn enum_output_type_and_content(

match variant.fields {
Fields::Unnamed(ref fields) => {
// The patern that is outputted should look like this:
// The pattern that is outputted should look like this:
// (Subtype(vars)) => Ok(TypePath(exprs))
let size = unnamed_to_vec(fields).len();
let vars: &Vec<_> =
Expand All @@ -118,7 +118,7 @@ fn enum_output_type_and_content(
matches.push(matcher);
}
Fields::Named(ref fields) => {
// The patern that is outputted should look like this:
// The pattern that is outputted should look like this:
// (Subtype{a: __l_a, ...} => {
// Ok(Subtype{a: __l_a.neg(__r_a), ...})
// }
Expand Down
20 changes: 10 additions & 10 deletions tests/error/nightly/derives_for_enums_with_backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum TestErr {
implicit_backtrace: Backtrace,
field: i32,
},
NamedExplicitSupressesImplicit {
NamedExplicitSuppressesImplicit {
#[error(backtrace)]
not_backtrace: MyBacktrace,
backtrace: Backtrace,
Expand Down Expand Up @@ -88,7 +88,7 @@ enum TestErr {
#[error(not(backtrace))] i32,
),
UnnamedExplicitBacktraceRedundant(#[error(backtrace)] Backtrace, i32, i32),
UnnamedExplicitSupressesImplicit(#[error(backtrace)] MyBacktrace, Backtrace, i32),
UnnamedExplicitSuppressesImplicit(#[error(backtrace)] MyBacktrace, Backtrace, i32),
UnnamedImplicitNoBacktraceFromSource(BacktraceErr),
UnnamedExplicitNoBacktraceFromSource(#[error(not(backtrace))] BacktraceErr),
UnnamedExplicitBacktraceFromSource(#[error(backtrace)] BacktraceErr),
Expand Down Expand Up @@ -119,7 +119,7 @@ impl TestErr {
implicit_backtrace: backtrace,
..
}
| Self::NamedExplicitSupressesImplicit {
| Self::NamedExplicitSuppressesImplicit {
not_backtrace: backtrace,
..
}
Expand All @@ -128,7 +128,7 @@ impl TestErr {
| Self::UnnamedImplicitBacktrace(backtrace, _, _)
| Self::UnnamedExplicitBacktrace(backtrace, _, _)
| Self::UnnamedExplicitBacktraceRedundant(backtrace, _, _)
| Self::UnnamedExplicitSupressesImplicit(backtrace, _, _)
| Self::UnnamedExplicitSuppressesImplicit(backtrace, _, _)
| Self::UnnamedImplicitDifferentSourceAndBacktrace(_, backtrace)
| Self::UnnamedExplicitDifferentSourceAndBacktrace(_, backtrace) => {
backtrace
Expand All @@ -139,8 +139,8 @@ impl TestErr {

fn get_unused_backtrace(&self) -> &Backtrace {
match self {
Self::NamedExplicitSupressesImplicit { backtrace, .. } => backtrace,
Self::UnnamedExplicitSupressesImplicit(_, backtrace, _) => backtrace,
Self::NamedExplicitSuppressesImplicit { backtrace, .. } => backtrace,
Self::UnnamedExplicitSuppressesImplicit(_, backtrace, _) => backtrace,
_ => panic!("ERROR IN TEST IMPLEMENTATION"),
}
}
Expand Down Expand Up @@ -259,8 +259,8 @@ fn named_explicit_backtrace_by_field_type_redundant() {
}

#[test]
fn named_explicit_supresses_implicit() {
let err = TestErr::NamedExplicitSupressesImplicit {
fn named_explicit_suppresses_implicit() {
let err = TestErr::NamedExplicitSuppressesImplicit {
not_backtrace: Backtrace::force_capture(),
backtrace: (|| Backtrace::force_capture())(), // ensure backtraces are different
field: 0,
Expand Down Expand Up @@ -391,8 +391,8 @@ fn unnamed_explicit_backtrace_redundant() {
}

#[test]
fn unnamed_explicit_supresses_implicit() {
let err = TestErr::UnnamedExplicitSupressesImplicit(
fn unnamed_explicit_suppresses_implicit() {
let err = TestErr::UnnamedExplicitSuppressesImplicit(
Backtrace::force_capture(),
(|| Backtrace::force_capture())(), // ensure backtraces are different
0,
Expand Down
22 changes: 12 additions & 10 deletions tests/error/nightly/derives_for_generic_enums_with_backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum TestErr<T> {
implicit_backtrace: Backtrace,
field: T,
},
NamedExplicitSupressesImplicit {
NamedExplicitSuppressesImplicit {
#[error(backtrace)]
not_backtrace: MyBacktrace,
backtrace: Backtrace,
Expand All @@ -65,7 +65,7 @@ enum TestErr<T> {
#[error(not(backtrace))] T,
),
UnnamedExplicitBacktraceRedundant(#[error(backtrace)] Backtrace, T, T),
UnnamedExplicitSupressesImplicit(#[error(backtrace)] MyBacktrace, Backtrace, T),
UnnamedExplicitSuppressesImplicit(#[error(backtrace)] MyBacktrace, Backtrace, T),
}

impl<T> TestErr<T> {
Expand All @@ -85,19 +85,21 @@ impl<T> TestErr<T> {
implicit_backtrace,
..
} => implicit_backtrace,
Self::NamedExplicitSupressesImplicit { not_backtrace, .. } => not_backtrace,
Self::NamedExplicitSuppressesImplicit { not_backtrace, .. } => {
not_backtrace
}
Self::UnnamedImplicitBacktrace(backtrace, _, _) => backtrace,
Self::UnnamedExplicitBacktrace(backtrace, _, _) => backtrace,
Self::UnnamedExplicitBacktraceRedundant(backtrace, _, _) => backtrace,
Self::UnnamedExplicitSupressesImplicit(backtrace, _, _) => backtrace,
Self::UnnamedExplicitSuppressesImplicit(backtrace, _, _) => backtrace,
_ => panic!("ERROR IN TEST IMPLEMENTATION"),
}
}

fn get_unused_backtrace(&self) -> &Backtrace {
match self {
Self::NamedExplicitSupressesImplicit { backtrace, .. } => backtrace,
Self::UnnamedExplicitSupressesImplicit(_, backtrace, _) => backtrace,
Self::NamedExplicitSuppressesImplicit { backtrace, .. } => backtrace,
Self::UnnamedExplicitSuppressesImplicit(_, backtrace, _) => backtrace,
_ => panic!("ERROR IN TEST IMPLEMENTATION"),
}
}
Expand Down Expand Up @@ -203,8 +205,8 @@ fn named_explicit_backtrace_by_field_type_redundant() {
}

#[test]
fn named_explicit_supresses_implicit() {
let err = TestErr::NamedExplicitSupressesImplicit {
fn named_explicit_suppresses_implicit() {
let err = TestErr::NamedExplicitSuppressesImplicit {
not_backtrace: Backtrace::force_capture(),
backtrace: (|| Backtrace::force_capture())(), // ensure backtraces are different
field: 0,
Expand Down Expand Up @@ -263,8 +265,8 @@ fn unnamed_explicit_backtrace_redundant() {
}

#[test]
fn unnamed_explicit_supresses_implicit() {
let err = TestErr::UnnamedExplicitSupressesImplicit(
fn unnamed_explicit_suppresses_implicit() {
let err = TestErr::UnnamedExplicitSuppressesImplicit(
Backtrace::force_capture(),
(|| Backtrace::force_capture())(), // ensure backtraces are different
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn named_explicit_backtrace_by_field_type_redundant() {
}

#[test]
fn named_explicit_supresses_implicit() {
fn named_explicit_suppresses_implicit() {
derive_display!(TestErr, T);
#[derive(Debug, Error)]
struct TestErr<T> {
Expand Down Expand Up @@ -373,7 +373,7 @@ fn unnamed_explicit_backtrace_redundant() {
}

#[test]
fn unnamed_explicit_supresses_implicit() {
fn unnamed_explicit_suppresses_implicit() {
derive_display!(TestErr, T);
#[derive(Debug, Error)]
struct TestErr<T>(#[error(backtrace)] MyBacktrace, Backtrace, T);
Expand Down
4 changes: 2 additions & 2 deletions tests/error/nightly/derives_for_structs_with_backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn named_explicit_backtrace_by_field_type_redundant() {
}

#[test]
fn named_explicit_supresses_implicit() {
fn named_explicit_suppresses_implicit() {
derive_display!(TestErr);
#[derive(Debug, Error)]
struct TestErr {
Expand Down Expand Up @@ -378,7 +378,7 @@ fn unnamed_explicit_backtrace_redundant() {
}

#[test]
fn unnamed_explicit_supresses_implicit() {
fn unnamed_explicit_suppresses_implicit() {
derive_display!(TestErr);
#[derive(Debug, Error)]
struct TestErr(#[error(backtrace)] MyBacktrace, Backtrace, i32);
Expand Down

0 comments on commit 294773a

Please sign in to comment.