Skip to content

Commit cd62410

Browse files
Daniil KlimovGrayJack
Daniil Klimov
authored andcommitted
The return of Cast is simplified
1 parent cb204d7 commit cd62410

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/bindgen/ir/ty.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,7 @@ impl ConstExpr {
270270
let generic_path = GenericPath::load(&path.path)?;
271271
Ok(ConstExpr::Name(generic_path.export_name().to_owned()))
272272
}
273-
syn::Expr::Cast(ref cast) => {
274-
let expr = match *cast.expr {
275-
syn::Expr::Path(ref path) => path,
276-
_ => return Err(format!("can't handle const expression {:?}", cast)),
277-
};
278-
let generic_path = GenericPath::load(&expr.path)?;
279-
Ok(ConstExpr::Name(generic_path.export_name().to_owned()))
280-
}
273+
syn::Expr::Cast(ref cast) => Ok(ConstExpr::load(&cast.expr)?),
281274
_ => Err(format!("can't handle const expression {:?}", expr)),
282275
}
283276
}

0 commit comments

Comments
 (0)