Fixed typos in local bindings

This commit is contained in:
Vincent Esche 2021-01-08 15:41:32 +01:00
parent 4702c01553
commit c8c2bd097a
3 changed files with 7 additions and 7 deletions

View File

@ -379,7 +379,7 @@ pub fn record_literal_missing_fields(
id: ExprId,
expr: &Expr,
) -> Option<(VariantId, Vec<LocalFieldId>, /*exhaustive*/ bool)> {
let (fields, exhausitve) = match expr {
let (fields, exhaustive) = match expr {
Expr::RecordLit { path: _, fields, spread } => (fields, spread.is_none()),
_ => return None,
};
@ -400,7 +400,7 @@ pub fn record_literal_missing_fields(
if missed_fields.is_empty() {
return None;
}
Some((variant_def, missed_fields, exhausitve))
Some((variant_def, missed_fields, exhaustive))
}
pub fn record_pattern_missing_fields(

View File

@ -491,16 +491,16 @@ fn select_associated_type(
fn from_hir_path_inner(
ctx: &TyLoweringContext<'_>,
segment: PathSegment<'_>,
typable: TyDefId,
typeable: TyDefId,
infer_args: bool,
) -> Ty {
let generic_def = match typable {
let generic_def = match typeable {
TyDefId::BuiltinType(_) => None,
TyDefId::AdtId(it) => Some(it.into()),
TyDefId::TypeAliasId(it) => Some(it.into()),
};
let substs = substs_from_path_segment(ctx, segment, generic_def, infer_args);
ctx.db.ty(typable).subst(&substs)
ctx.db.ty(typeable).subst(&substs)
}
/// Collect generic arguments from a path into a `Substs`. See also

View File

@ -88,8 +88,8 @@ pub fn least_common_ancestor(u: &SyntaxNode, v: &SyntaxNode) -> Option<SyntaxNod
let keep = u_depth.min(v_depth);
let u_candidates = u.ancestors().skip(u_depth - keep);
let v_canidates = v.ancestors().skip(v_depth - keep);
let (res, _) = u_candidates.zip(v_canidates).find(|(x, y)| x == y)?;
let v_candidates = v.ancestors().skip(v_depth - keep);
let (res, _) = u_candidates.zip(v_candidates).find(|(x, y)| x == y)?;
Some(res)
}