diff --git a/source/common/buffer/buffer_impl.cc b/source/common/buffer/buffer_impl.cc index b57173a1f3b8b..3d2b274834664 100644 --- a/source/common/buffer/buffer_impl.cc +++ b/source/common/buffer/buffer_impl.cc @@ -206,7 +206,8 @@ RawSlice OwnedImpl::frontSlice() const { // Ignore zero-size slices and return the first slice with data. for (const auto& slice : slices_) { if (slice.dataSize() > 0) { - return RawSlice{const_cast(slice.data()), slice.dataSize()}; + return RawSlice{const_cast(slice.data()), + static_cast::size_type>(slice.dataSize())}; } } diff --git a/source/common/buffer/buffer_impl.h b/source/common/buffer/buffer_impl.h index eaecb5d719ff2..c557107df0505 100644 --- a/source/common/buffer/buffer_impl.h +++ b/source/common/buffer/buffer_impl.h @@ -326,7 +326,7 @@ class SliceDataImpl : public SliceData { // SliceData absl::Span getMutableData() override { RELEASE_ASSERT(slice_.isMutable(), "Not allowed to call getMutableData if slice is immutable"); - return {slice_.data(), slice_.dataSize()}; + return {slice_.data(), static_cast::size_type>(slice_.dataSize())}; } private: