mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
Use impl_froms!
This commit is contained in:
parent
1578375b89
commit
ac678473b8
1 changed files with 3 additions and 13 deletions
|
@ -57,21 +57,11 @@ pub fn infer(db: &impl HirDatabase, func: Function) -> Arc<InferenceResult> {
|
|||
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
enum ExprOrPatId {
|
||||
Expr(ExprId),
|
||||
Pat(PatId),
|
||||
ExprId(ExprId),
|
||||
PatId(PatId),
|
||||
}
|
||||
|
||||
impl From<ExprId> for ExprOrPatId {
|
||||
fn from(id: ExprId) -> Self {
|
||||
ExprOrPatId::Expr(id)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PatId> for ExprOrPatId {
|
||||
fn from(id: PatId) -> Self {
|
||||
ExprOrPatId::Pat(id)
|
||||
}
|
||||
}
|
||||
impl_froms!(ExprOrPatId: ExprId, PatId);
|
||||
|
||||
/// The result of type inference: A mapping from expressions and patterns to types.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
|
|
Loading…
Reference in a new issue