-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
897cce8
commit 41caad1
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
crates/ruff_python_formatter/src/pattern/pattern_match_value.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
use ruff_formatter::{write, Buffer, FormatResult}; | ||
use ruff_python_ast::PatternMatchValue; | ||
|
||
use crate::{not_yet_implemented_custom_text, FormatNodeRule, PyFormatter}; | ||
use crate::{AsFormat, FormatNodeRule, PyFormatter}; | ||
|
||
#[derive(Default)] | ||
pub struct FormatPatternMatchValue; | ||
|
||
impl FormatNodeRule<PatternMatchValue> for FormatPatternMatchValue { | ||
fn fmt_fields(&self, item: &PatternMatchValue, f: &mut PyFormatter) -> FormatResult<()> { | ||
write!( | ||
f, | ||
[not_yet_implemented_custom_text( | ||
"\"NOT_YET_IMPLEMENTED_PatternMatchValue\"", | ||
item | ||
)] | ||
) | ||
let PatternMatchValue { value, .. } = item; | ||
|
||
let formatted = value.format(); | ||
|
||
write!(f, [formatted]) | ||
} | ||
} |