mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-17 09:00:48 +00:00
Format Function definitions (#4951)
This commit is contained in:
parent
07cc4bcb0f
commit
68969240c5
79 changed files with 2601 additions and 1223 deletions
|
@ -2858,3 +2858,35 @@ impl<'ast> IntoFormat<PyFormatContext<'ast>> for ast::MatchCase {
|
|||
FormatOwnedWithRule::new(self, crate::other::match_case::FormatMatchCase::default())
|
||||
}
|
||||
}
|
||||
|
||||
impl FormatRule<ast::Decorator, PyFormatContext<'_>> for crate::other::decorator::FormatDecorator {
|
||||
#[inline]
|
||||
fn fmt(
|
||||
&self,
|
||||
node: &ast::Decorator,
|
||||
f: &mut Formatter<PyFormatContext<'_>>,
|
||||
) -> FormatResult<()> {
|
||||
FormatNodeRule::<ast::Decorator>::fmt(self, node, f)
|
||||
}
|
||||
}
|
||||
impl<'ast> AsFormat<PyFormatContext<'ast>> for ast::Decorator {
|
||||
type Format<'a> = FormatRefWithRule<
|
||||
'a,
|
||||
ast::Decorator,
|
||||
crate::other::decorator::FormatDecorator,
|
||||
PyFormatContext<'ast>,
|
||||
>;
|
||||
fn format(&self) -> Self::Format<'_> {
|
||||
FormatRefWithRule::new(self, crate::other::decorator::FormatDecorator::default())
|
||||
}
|
||||
}
|
||||
impl<'ast> IntoFormat<PyFormatContext<'ast>> for ast::Decorator {
|
||||
type Format = FormatOwnedWithRule<
|
||||
ast::Decorator,
|
||||
crate::other::decorator::FormatDecorator,
|
||||
PyFormatContext<'ast>,
|
||||
>;
|
||||
fn into_format(self) -> Self::Format {
|
||||
FormatOwnedWithRule::new(self, crate::other::decorator::FormatDecorator::default())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue