mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 21:43:37 +00:00
Fixed typos in local bindings
This commit is contained in:
parent
4702c01553
commit
c8c2bd097a
3 changed files with 7 additions and 7 deletions
|
@ -379,7 +379,7 @@ pub fn record_literal_missing_fields(
|
||||||
id: ExprId,
|
id: ExprId,
|
||||||
expr: &Expr,
|
expr: &Expr,
|
||||||
) -> Option<(VariantId, Vec<LocalFieldId>, /*exhaustive*/ bool)> {
|
) -> 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()),
|
Expr::RecordLit { path: _, fields, spread } => (fields, spread.is_none()),
|
||||||
_ => return None,
|
_ => return None,
|
||||||
};
|
};
|
||||||
|
@ -400,7 +400,7 @@ pub fn record_literal_missing_fields(
|
||||||
if missed_fields.is_empty() {
|
if missed_fields.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
Some((variant_def, missed_fields, exhausitve))
|
Some((variant_def, missed_fields, exhaustive))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn record_pattern_missing_fields(
|
pub fn record_pattern_missing_fields(
|
||||||
|
|
|
@ -491,16 +491,16 @@ impl Ty {
|
||||||
fn from_hir_path_inner(
|
fn from_hir_path_inner(
|
||||||
ctx: &TyLoweringContext<'_>,
|
ctx: &TyLoweringContext<'_>,
|
||||||
segment: PathSegment<'_>,
|
segment: PathSegment<'_>,
|
||||||
typable: TyDefId,
|
typeable: TyDefId,
|
||||||
infer_args: bool,
|
infer_args: bool,
|
||||||
) -> Ty {
|
) -> Ty {
|
||||||
let generic_def = match typable {
|
let generic_def = match typeable {
|
||||||
TyDefId::BuiltinType(_) => None,
|
TyDefId::BuiltinType(_) => None,
|
||||||
TyDefId::AdtId(it) => Some(it.into()),
|
TyDefId::AdtId(it) => Some(it.into()),
|
||||||
TyDefId::TypeAliasId(it) => Some(it.into()),
|
TyDefId::TypeAliasId(it) => Some(it.into()),
|
||||||
};
|
};
|
||||||
let substs = substs_from_path_segment(ctx, segment, generic_def, infer_args);
|
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
|
/// Collect generic arguments from a path into a `Substs`. See also
|
||||||
|
|
|
@ -88,8 +88,8 @@ pub fn least_common_ancestor(u: &SyntaxNode, v: &SyntaxNode) -> Option<SyntaxNod
|
||||||
let keep = u_depth.min(v_depth);
|
let keep = u_depth.min(v_depth);
|
||||||
|
|
||||||
let u_candidates = u.ancestors().skip(u_depth - keep);
|
let u_candidates = u.ancestors().skip(u_depth - keep);
|
||||||
let v_canidates = v.ancestors().skip(v_depth - keep);
|
let v_candidates = v.ancestors().skip(v_depth - keep);
|
||||||
let (res, _) = u_candidates.zip(v_canidates).find(|(x, y)| x == y)?;
|
let (res, _) = u_candidates.zip(v_candidates).find(|(x, y)| x == y)?;
|
||||||
Some(res)
|
Some(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue