From: Marc-André Lureau <marcandre.lureau@redhat.com>
This help workaround a rustfmt issue.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
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 ab26d5c937..fa23f43808 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -50,7 +50,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.33.0.113.g6c40894d24