From 8b2aa01b3da628c3b8c80ced70f01a60dbd7d593 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 23 Oct 2024 09:31:27 +0200 Subject: [PATCH] stream: [[nodiscard]] --- src/uvw/stream.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uvw/stream.h b/src/uvw/stream.h index a7b26983..1be8af56 100644 --- a/src/uvw/stream.h +++ b/src/uvw/stream.h @@ -142,11 +142,11 @@ class stream_handle: public handle(this->raw()); } - const uv_stream_t *as_uv_stream() const { + [[nodiscard]] const uv_stream_t *as_uv_stream() const { return reinterpret_cast(this->raw()); } @@ -432,7 +432,7 @@ public: * @brief Checks if the stream is readable. * @return True if the stream is readable, false otherwise. */ - bool readable() const noexcept { + [[nodiscard]] bool readable() const noexcept { return (uv_is_readable(as_uv_stream()) == 1); } @@ -440,7 +440,7 @@ public: * @brief Checks if the stream is writable. * @return True if the stream is writable, false otherwise. */ - bool writable() const noexcept { + [[nodiscard]] bool writable() const noexcept { return (uv_is_writable(as_uv_stream()) == 1); } @@ -467,7 +467,7 @@ public: * @brief Gets the amount of queued bytes waiting to be sent. * @return Amount of queued bytes waiting to be sent. */ - size_t write_queue_size() const noexcept { + [[nodiscard]] size_t write_queue_size() const noexcept { return uv_stream_get_write_queue_size(as_uv_stream()); } };