mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-15 00:55:22 +00:00
Refactor common::str::repr using common::escape
This commit is contained in:
parent
ae9d3c3193
commit
5b0e92d725
2 changed files with 6 additions and 2 deletions
|
@ -509,9 +509,10 @@ impl<'a> Unparser<'a> {
|
|||
if is_spec {
|
||||
self.unparse_fstring_body(values, is_spec)
|
||||
} else {
|
||||
use rustpython_common::escape::Escape;
|
||||
self.p("f")?;
|
||||
let body = to_string_fmt(|f| Unparser::new(f).unparse_fstring_body(values, is_spec));
|
||||
fmt::Display::fmt(&rustpython_common::str::repr(&body), &mut self.f)
|
||||
rustpython_common::escape::UnicodeEscape::new_repr(&body).write_quoted(&mut self.f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue