mirror of
https://github.com/astral-sh/ruff
synced 2026-01-11 00:24:13 -05:00
ruff_python_ast: Make Singleton Copy (#14943)
## Summary Minor changed pulled out from #14759, as it seems to make sense in isolation. ## Test Plan —
This commit is contained in:
@@ -669,7 +669,7 @@ impl<'a> Generator<'a> {
|
||||
self.unparse_expr(value, precedence::MAX);
|
||||
}
|
||||
Pattern::MatchSingleton(ast::PatternMatchSingleton { value, range: _ }) => {
|
||||
self.unparse_singleton(value);
|
||||
self.unparse_singleton(*value);
|
||||
}
|
||||
Pattern::MatchSequence(ast::PatternMatchSequence { patterns, range: _ }) => {
|
||||
self.p("[");
|
||||
@@ -1211,7 +1211,7 @@ impl<'a> Generator<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn unparse_singleton(&mut self, singleton: &Singleton) {
|
||||
pub(crate) fn unparse_singleton(&mut self, singleton: Singleton) {
|
||||
match singleton {
|
||||
Singleton::None => self.p("None"),
|
||||
Singleton::True => self.p("True"),
|
||||
|
||||
Reference in New Issue
Block a user