mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:42:02 +00:00
Remove source position from FormatElement::DynamicText
(#4619)
This commit is contained in:
parent
85f094f592
commit
6943beee66
20 changed files with 165 additions and 145 deletions
|
@ -1,6 +1,5 @@
|
|||
use ruff_formatter::prelude::*;
|
||||
use ruff_formatter::write;
|
||||
use ruff_text_size::TextSize;
|
||||
|
||||
use crate::context::ASTFormatContext;
|
||||
use crate::cst::{Excepthandler, ExcepthandlerKind};
|
||||
|
@ -29,15 +28,7 @@ impl Format<ASTFormatContext> for FormatExcepthandler<'_> {
|
|||
if let Some(type_) = &type_ {
|
||||
write!(f, [space(), type_.format()])?;
|
||||
if let Some(name) = &name {
|
||||
write!(
|
||||
f,
|
||||
[
|
||||
space(),
|
||||
text("as"),
|
||||
space(),
|
||||
dynamic_text(name, TextSize::default()),
|
||||
]
|
||||
)?;
|
||||
write!(f, [space(), text("as"), space(), dynamic_text(name, None)])?;
|
||||
}
|
||||
}
|
||||
write!(f, [text(":")])?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue