mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Use .as_ref()
in lieu of &**
(#5874)
I find this less opaque (and often more succinct).
This commit is contained in:
parent
7ffcd93afd
commit
626d8dc2cc
7 changed files with 17 additions and 21 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue