mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-14 15:40:51 +00:00
Formatter: Remove unnecessary group
(#8455)
This commit is contained in:
parent
d04d964ace
commit
f16505d885
2 changed files with 1 additions and 24 deletions
|
@ -2516,33 +2516,10 @@ impl Parameters {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::borrowed_box)] // local utility
|
||||
fn clone_boxed_expr(expr: &Box<Expr>) -> Box<Expr> {
|
||||
let expr: &Expr = expr.as_ref();
|
||||
Box::new(expr.clone())
|
||||
}
|
||||
|
||||
impl ParameterWithDefault {
|
||||
pub fn as_parameter(&self) -> &Parameter {
|
||||
&self.parameter
|
||||
}
|
||||
|
||||
pub fn to_parameter(&self) -> (Parameter, Option<Box<Expr>>) {
|
||||
let ParameterWithDefault {
|
||||
range: _,
|
||||
parameter,
|
||||
default,
|
||||
} = self;
|
||||
(parameter.clone(), default.as_ref().map(clone_boxed_expr))
|
||||
}
|
||||
pub fn into_parameter(self) -> (Parameter, Option<Box<Expr>>) {
|
||||
let ParameterWithDefault {
|
||||
range: _,
|
||||
parameter,
|
||||
default,
|
||||
} = self;
|
||||
(parameter, default)
|
||||
}
|
||||
}
|
||||
|
||||
impl Parameters {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue