Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330)

This is a refactoring to use the type alias in more places. In the
process, I had to fix and run generate.py. There are no functional
changes.
This commit is contained in:
konsti 2023-08-04 10:48:58 +02:00 committed by GitHub
parent 8a5bc93fdd
commit a48d16e025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 212 additions and 424 deletions

View file

@ -17,7 +17,7 @@ impl<'a> FormatInt<'a> {
}
impl Format<PyFormatContext<'_>> for FormatInt<'_> {
fn fmt(&self, f: &mut Formatter<PyFormatContext<'_>>) -> FormatResult<()> {
fn fmt(&self, f: &mut PyFormatter) -> FormatResult<()> {
let range = self.constant.range();
let content = f.context().locator().slice(range);
@ -42,7 +42,7 @@ impl<'a> FormatFloat<'a> {
}
impl Format<PyFormatContext<'_>> for FormatFloat<'_> {
fn fmt(&self, f: &mut Formatter<PyFormatContext<'_>>) -> FormatResult<()> {
fn fmt(&self, f: &mut PyFormatter) -> FormatResult<()> {
let range = self.constant.range();
let content = f.context().locator().slice(range);
@ -67,7 +67,7 @@ impl<'a> FormatComplex<'a> {
}
impl Format<PyFormatContext<'_>> for FormatComplex<'_> {
fn fmt(&self, f: &mut Formatter<PyFormatContext<'_>>) -> FormatResult<()> {
fn fmt(&self, f: &mut PyFormatter) -> FormatResult<()> {
let range = self.constant.range();
let content = f.context().locator().slice(range);