mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-15 00:55:22 +00:00
Refactor common::bytes::repr using common::escape
This commit is contained in:
parent
5b0e92d725
commit
bd64603950
2 changed files with 9 additions and 7 deletions
|
@ -509,10 +509,11 @@ 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));
|
||||
rustpython_common::escape::UnicodeEscape::new_repr(&body).write_quoted(&mut self.f)
|
||||
rustpython_common::escape::UnicodeEscape::new_repr(&body)
|
||||
.str_repr()
|
||||
.write(&mut self.f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue