[api] Mark the cursor returning encode helpers nodiscard

A call that drops the returned cursor would silently truncate the message, so the
compiler now warns on it and a unit test scans the generated file for the same mistake.
Also corrects the outlining comment for ESP8266, where the inline write is a few byte
stores rather than one, and the RAW_ENCODE_MAP annotation.
This commit is contained in:
J. Nick Koston
2026-09-07 12:37:48 +02:00
parent d2e4d2c46a
commit 822b701792
3 changed files with 74 additions and 61 deletions
+1 -1
View File
@@ -732,7 +732,7 @@ class UInt64Type(VarintTypeMixin, TypeInfo):
return self._get_simple_size_calculation(name, force, "uint64")
@property
def RAW_ENCODE_MAP(self) -> dict[str, str]: # noqa: N802
def RAW_ENCODE_MAP(self) -> dict[str, tuple[str, str]]: # noqa: N802
if self.mac_address:
return {
**TypeInfo.RAW_ENCODE_MAP,