From dc51315530070a395300695c50b172c4fdce6deb Mon Sep 17 00:00:00 2001 From: Armando Montanez Date: Wed, 12 May 2021 13:11:30 -0700 Subject: [PATCH] pw_stream: Make MemoryWriter::data() non-const Allows mutable access to a MemoryWriter's underlying buffer. No-Docs-Update-Reason: Changing a data() accessor to non-const. Change-Id: I02a1c21e670ba63f6de98441a851eddc03095cf5 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/45001 Reviewed-by: Wyatt Hepler Commit-Queue: Auto-Submit Pigweed-Auto-Submit: Armando Montanez --- pw_stream/public/pw_stream/memory_stream.h | 1 + 1 file changed, 1 insertion(+) diff --git a/pw_stream/public/pw_stream/memory_stream.h b/pw_stream/public/pw_stream/memory_stream.h index 84d9f5df2..1ccf9ab6a 100644 --- a/pw_stream/public/pw_stream/memory_stream.h +++ b/pw_stream/public/pw_stream/memory_stream.h @@ -35,6 +35,7 @@ class MemoryWriter : public Writer { ConstByteSpan WrittenData() const { return dest_.first(bytes_written_); } + std::byte* data() { return dest_.data(); } const std::byte* data() const { return dest_.data(); } private: