mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 15:14:19 -05:00
Use .as_ref() in lieu of &** (#5874)
I find this less opaque (and often more succinct).
This commit is contained in:
@@ -44,8 +44,8 @@ pub enum PythonType {
|
||||
impl From<&Expr> for PythonType {
|
||||
fn from(expr: &Expr) -> Self {
|
||||
match expr {
|
||||
Expr::NamedExpr(ast::ExprNamedExpr { value, .. }) => (&**value).into(),
|
||||
Expr::UnaryOp(ast::ExprUnaryOp { operand, .. }) => (&**operand).into(),
|
||||
Expr::NamedExpr(ast::ExprNamedExpr { value, .. }) => (value.as_ref()).into(),
|
||||
Expr::UnaryOp(ast::ExprUnaryOp { operand, .. }) => (operand.as_ref()).into(),
|
||||
Expr::Dict(_) => PythonType::Dict,
|
||||
Expr::DictComp(_) => PythonType::Dict,
|
||||
Expr::Set(_) => PythonType::Set,
|
||||
|
||||
Reference in New Issue
Block a user