Fix various typos in lint messages, descriptions and comments

This commit is contained in:
Samuel Tardieu 2025-03-24 15:58:40 +01:00
parent b27a2bbe26
commit 621911a677
15 changed files with 47 additions and 47 deletions

View file

@ -1,4 +1,4 @@
/// Dealing with sting indices can be hard, this struct ensures that both the
/// Dealing with string indices can be hard, this struct ensures that both the
/// character and byte index are provided for correct indexing.
#[derive(Debug, Default, PartialEq, Eq)]
pub struct StrIndex {
@ -165,7 +165,7 @@ pub fn camel_case_split(s: &str) -> Vec<&str> {
offsets.windows(2).map(|w| &s[w[0]..w[1]]).collect()
}
/// Dealing with sting comparison can be complicated, this struct ensures that both the
/// Dealing with string comparison can be complicated, this struct ensures that both the
/// character and byte count are provided for correct indexing.
#[derive(Debug, Default, PartialEq, Eq)]
pub struct StrCount {

View file

@ -1352,7 +1352,7 @@ pub fn get_adt_inherent_method<'a>(cx: &'a LateContext<'_>, ty: Ty<'_>, method_n
}
}
/// Get's the type of a field by name.
/// Gets the type of a field by name.
pub fn get_field_by_name<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, name: Symbol) -> Option<Ty<'tcx>> {
match *ty.kind() {
ty::Adt(def, args) if def.is_union() || def.is_struct() => def