From: Marc-André Lureau <[email protected]> This help workaround a rustfmt issue.
Signed-off-by: Marc-André Lureau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Bonzini <[email protected]> --- scripts/qapi/gen.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 0c9b8db3b02..c9721545ea7 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -58,7 +58,11 @@ def add(self, text: str) -> None: self._body += text def get_content(self) -> str: - return self._top() + self._preamble + self._body + self._bottom() + content = self._top() + self._preamble + self._body + self._bottom() + # delete trailing white-spaces (working around + # https://github.com/rust-lang/rustfmt/issues/4248) + content = re.sub(r'\s+$', '\n', content, 0, re.M) + return content def _top(self) -> str: # pylint: disable=no-self-use -- 2.51.0
