chore: fix some typos in comments

Signed-off-by: forcedebug <forcedebug@outlook.com>
This commit is contained in:
forcedebug 2024-04-23 20:31:26 +08:00
parent 7fcaa60efd
commit d55e5b4500
7 changed files with 7 additions and 7 deletions

View File

@ -24,7 +24,7 @@ declare_clippy_lint! {
/// ///
/// ### Limitations /// ### Limitations
/// This lint does not check for implied bounds transitively. Meaning that /// This lint does not check for implied bounds transitively. Meaning that
/// it does't check for implied bounds from supertraits of supertraits /// it doesn't check for implied bounds from supertraits of supertraits
/// (e.g. `trait A {} trait B: A {} trait C: B {}`, then having an `fn() -> impl A + C`) /// (e.g. `trait A {} trait B: A {} trait C: B {}`, then having an `fn() -> impl A + C`)
/// ///
/// ### Example /// ### Example

View File

@ -78,7 +78,7 @@ pub(super) fn check(cx: &LateContext<'_>, call_expr: &Expr<'_>, recv: &Expr<'_>,
&& match_def_path(cx, enumerate_defid, &CORE_ITER_ENUMERATE_METHOD) && match_def_path(cx, enumerate_defid, &CORE_ITER_ENUMERATE_METHOD)
{ {
// Check if the tuple type was explicit. It may be the type system _needs_ the type of the element // Check if the tuple type was explicit. It may be the type system _needs_ the type of the element
// that would be explicited in the closure. // that would be explicitly in the closure.
let new_closure_param = match find_elem_explicit_type_span(closure.fn_decl) { let new_closure_param = match find_elem_explicit_type_span(closure.fn_decl) {
// We have an explicit type. Get its snippet, that of the binding name, and do `binding: ty`. // We have an explicit type. Get its snippet, that of the binding name, and do `binding: ty`.
// Fallback to `..` if we fail getting either snippet. // Fallback to `..` if we fail getting either snippet.

View File

@ -28,7 +28,7 @@ declare_clippy_lint! {
/// fn size(&self) -> usize { /// fn size(&self) -> usize {
/// // Note that `&self` as an argument is a `&&Foo`: Because `self` /// // Note that `&self` as an argument is a `&&Foo`: Because `self`
/// // is already a reference, `&self` is a double-reference. /// // is already a reference, `&self` is a double-reference.
/// // The return value of `size_of_val()` therefor is the /// // The return value of `size_of_val()` therefore is the
/// // size of the reference-type, not the size of `self`. /// // size of the reference-type, not the size of `self`.
/// std::mem::size_of_val(&self) /// std::mem::size_of_val(&self)
/// } /// }

View File

@ -32,7 +32,7 @@ fn main() {
// testing that the suggestion actually fits in its type // testing that the suggestion actually fits in its type
let fail30 = 127_i8; // should be i8 let fail30 = 127_i8; // should be i8
let fail31 = 240_u8; // should be u8 let fail31 = 240_u8; // should be u8
let ok32 = 360_8; // doesnt fit in either, should be ignored let ok32 = 360_8; // doesn't fit in either, should be ignored
let fail33 = 0x1234_i16; let fail33 = 0x1234_i16;
let fail34 = 0xABCD_u16; let fail34 = 0xABCD_u16;
let ok35 = 0x12345_16; let ok35 = 0x12345_16;

View File

@ -32,7 +32,7 @@ fn main() {
// testing that the suggestion actually fits in its type // testing that the suggestion actually fits in its type
let fail30 = 127_8; // should be i8 let fail30 = 127_8; // should be i8
let fail31 = 240_8; // should be u8 let fail31 = 240_8; // should be u8
let ok32 = 360_8; // doesnt fit in either, should be ignored let ok32 = 360_8; // doesn't fit in either, should be ignored
let fail33 = 0x1234_16; let fail33 = 0x1234_16;
let fail34 = 0xABCD_16; let fail34 = 0xABCD_16;
let ok35 = 0x12345_16; let ok35 = 0x12345_16;

View File

@ -19,7 +19,7 @@ where
impl<T> NormalTrait for T {} impl<T> NormalTrait for T {}
fn main() { fn main() {
// (currently we don't look deeper than one level into the supertrait hierachy, but we probably // (currently we don't look deeper than one level into the supertrait hierarchy, but we probably
// could) // could)
let b: Box<dyn AnySubSubTrait> = Box::new(1); let b: Box<dyn AnySubSubTrait> = Box::new(1);
let _ = b.type_id(); let _ = b.type_id();

View File

@ -415,7 +415,7 @@
let terms = searchStr.split(" "); let terms = searchStr.split(" ");
let docsLowerCase = lint.docs.toLowerCase(); let docsLowerCase = lint.docs.toLowerCase();
for (index = 0; index < terms.length; index++) { for (index = 0; index < terms.length; index++) {
// This is more likely and will therefor be checked first // This is more likely and will therefore be checked first
if (docsLowerCase.indexOf(terms[index]) !== -1) { if (docsLowerCase.indexOf(terms[index]) !== -1) {
continue; continue;
} }