mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
Make Buffer::write_element
non-failable (#6613)
This commit is contained in:
parent
86ccdcc9d9
commit
daac31d2b9
9 changed files with 115 additions and 215 deletions
|
@ -855,7 +855,7 @@ impl Format<PyFormatContext<'_>> for VerbatimText {
|
|||
tag::VerbatimKind::Verbatim {
|
||||
length: self.verbatim_range.len(),
|
||||
},
|
||||
)))?;
|
||||
)));
|
||||
|
||||
match normalize_newlines(f.context().locator().slice(self.verbatim_range), ['\r']) {
|
||||
Cow::Borrowed(_) => {
|
||||
|
@ -878,6 +878,7 @@ impl Format<PyFormatContext<'_>> for VerbatimText {
|
|||
}
|
||||
}
|
||||
|
||||
f.write_element(FormatElement::Tag(Tag::EndVerbatim))
|
||||
f.write_element(FormatElement::Tag(Tag::EndVerbatim));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue