-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_protobuf: Add StreamEncoder::CloseEncoder
Previously, `StreamEncoder` would only perform writes to its parent after destruction occurred. This resulted in callers frequently needing to introduce new scopes, often with a comment explaining the API to readers. This change adds the `CloseEncoder` method, which explicitly finalizes the child encoder and performs the writes to the parent, allowing users both to close an encoder before the end of its lexical scope and to make their code more explicit and self-descriptive if desired. Change-Id: Ieedf99048da3fe2d87602eea1ae85165c378d70a Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/103922 Reviewed-by: Alexei Frolov <frolv@google.com> Commit-Queue: Taylor Cramer <cramertj@google.com>
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters