diff --git a/src/uvw/stream.hpp b/src/uvw/stream.hpp index 239f7dde..f1eb8dda 100644 --- a/src/uvw/stream.hpp +++ b/src/uvw/stream.hpp @@ -62,11 +62,11 @@ struct WriteEvent: Event { }; * It will be emitted by StreamHandle according with its functionalities. */ struct DataEvent: Event { - explicit DataEvent(std::unique_ptr data, ssize_t length) noexcept + explicit DataEvent(std::unique_ptr data, ssize_t length) noexcept : data{std::move(data)}, length(length) { } - std::unique_ptr data; /*!< A bunch of data read on the stream. */ + std::unique_ptr data; /*!< A bunch of data read on the stream. */ std::size_t length; /*!< The amount of data read on the stream. */ }; @@ -143,7 +143,7 @@ class StreamHandle: public Handle { static void readCallback(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf) { T &ref = *(static_cast(handle->data)); // data will be destroyed no matter of what the value of nread is - std::unique_ptr data{buf->base}; + std::unique_ptr data{buf->base}; if(nread == UV_EOF) { // end of stream