From 244785112ff5bca2f7575e8af9f62a6d39801ff9 Mon Sep 17 00:00:00 2001 From: wuaoxiang Date: Tue, 20 Jun 2023 15:03:56 +0800 Subject: [PATCH] Fix typo --- impl/doc/as_mut.md | 2 +- impl/doc/as_ref.md | 2 +- impl/doc/debug.md | 2 +- impl/doc/into.md | 2 +- impl/src/add_like.rs | 2 +- impl/src/from_str.rs | 2 +- impl/src/not_like.rs | 4 ++-- .../derives_for_enums_with_backtrace.rs | 20 +++++++++---------- ...erives_for_generic_enums_with_backtrace.rs | 20 +++++++++---------- ...ives_for_generic_structs_with_backtrace.rs | 4 ++-- .../derives_for_structs_with_backtrace.rs | 4 ++-- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/impl/doc/as_mut.md b/impl/doc/as_mut.md index 20ebdcb0..a1e6127d 100644 --- a/impl/doc/as_mut.md +++ b/impl/doc/as_mut.md @@ -32,7 +32,7 @@ impl AsMut 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` implements `AsMut` for. ```rust diff --git a/impl/doc/as_ref.md b/impl/doc/as_ref.md index e8e27a9a..112ba15a 100644 --- a/impl/doc/as_ref.md +++ b/impl/doc/as_ref.md @@ -32,7 +32,7 @@ impl AsRef 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` implements `AsRef` for. ```rust diff --git a/impl/doc/debug.md b/impl/doc/debug.md index 935c52d8..b643976d 100644 --- a/impl/doc/debug.md +++ b/impl/doc/debug.md @@ -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. diff --git a/impl/doc/into.md b/impl/doc/into.md index ded97d2f..16d0c2b8 100644 --- a/impl/doc/into.md +++ b/impl/doc/into.md @@ -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 diff --git a/impl/src/add_like.rs b/impl/src/add_like.rs index 7427a39c..eaf8417f 100644 --- a/impl/src/add_like.rs +++ b/impl/src/add_like.rs @@ -104,7 +104,7 @@ fn enum_content( matches.push(matcher); } Fields::Named(ref fields) => { - // The patern that is outputted should look like this: + // The patternfd that is outputted should look like this: // (Subtype{a: __l_a, ...}, Subtype{a: __r_a, ...} => { // Ok(Subtype{a: __l_a.add(__r_a), ...}) // } diff --git a/impl/src/from_str.rs b/impl/src/from_str.rs index f61af1bb..0d3773dd 100644 --- a/impl/src/from_str.rs +++ b/impl/src/from_str.rs @@ -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 { diff --git a/impl/src/not_like.rs b/impl/src/not_like.rs index be4a84fa..6bab7c8e 100644 --- a/impl/src/not_like.rs +++ b/impl/src/not_like.rs @@ -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<_> = @@ -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), ...}) // } diff --git a/tests/error/nightly/derives_for_enums_with_backtrace.rs b/tests/error/nightly/derives_for_enums_with_backtrace.rs index e3a95dc4..ca1a11b9 100644 --- a/tests/error/nightly/derives_for_enums_with_backtrace.rs +++ b/tests/error/nightly/derives_for_enums_with_backtrace.rs @@ -50,7 +50,7 @@ enum TestErr { implicit_backtrace: Backtrace, field: i32, }, - NamedExplicitSupressesImplicit { + NamedExplicitSuppressesImplicit { #[error(backtrace)] not_backtrace: MyBacktrace, backtrace: Backtrace, @@ -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), @@ -119,7 +119,7 @@ impl TestErr { implicit_backtrace: backtrace, .. } - | Self::NamedExplicitSupressesImplicit { + | Self::NamedExplicitSuppressesImplicit { not_backtrace: backtrace, .. } @@ -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 @@ -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"), } } @@ -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, @@ -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, diff --git a/tests/error/nightly/derives_for_generic_enums_with_backtrace.rs b/tests/error/nightly/derives_for_generic_enums_with_backtrace.rs index 8ca22e99..aab8e3bb 100644 --- a/tests/error/nightly/derives_for_generic_enums_with_backtrace.rs +++ b/tests/error/nightly/derives_for_generic_enums_with_backtrace.rs @@ -50,7 +50,7 @@ enum TestErr { implicit_backtrace: Backtrace, field: T, }, - NamedExplicitSupressesImplicit { + NamedExplicitSuppressesImplicit { #[error(backtrace)] not_backtrace: MyBacktrace, backtrace: Backtrace, @@ -65,7 +65,7 @@ enum TestErr { #[error(not(backtrace))] T, ), UnnamedExplicitBacktraceRedundant(#[error(backtrace)] Backtrace, T, T), - UnnamedExplicitSupressesImplicit(#[error(backtrace)] MyBacktrace, Backtrace, T), + UnnamedExplicitSuppressesImplicit(#[error(backtrace)] MyBacktrace, Backtrace, T), } impl TestErr { @@ -85,19 +85,19 @@ impl TestErr { 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"), } } @@ -203,8 +203,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, @@ -263,8 +263,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, diff --git a/tests/error/nightly/derives_for_generic_structs_with_backtrace.rs b/tests/error/nightly/derives_for_generic_structs_with_backtrace.rs index 83fa9c57..d2f2c011 100644 --- a/tests/error/nightly/derives_for_generic_structs_with_backtrace.rs +++ b/tests/error/nightly/derives_for_generic_structs_with_backtrace.rs @@ -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 { @@ -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(#[error(backtrace)] MyBacktrace, Backtrace, T); diff --git a/tests/error/nightly/derives_for_structs_with_backtrace.rs b/tests/error/nightly/derives_for_structs_with_backtrace.rs index e63483d6..a2623759 100644 --- a/tests/error/nightly/derives_for_structs_with_backtrace.rs +++ b/tests/error/nightly/derives_for_structs_with_backtrace.rs @@ -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 { @@ -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);