From 79ef6855eb38edd03b51d2f5a2f614cdd7b9fcf1 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 3 Sep 2026 13:38:00 +0200 Subject: chore: add missing [[nodiscard]] attributes --- kapi/kapi/devices/facet_registry.hpp | 9 +++++---- kapi/kapi/devices/power.hpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'kapi') diff --git a/kapi/kapi/devices/facet_registry.hpp b/kapi/kapi/devices/facet_registry.hpp index 7006c026..3c405923 100644 --- a/kapi/kapi/devices/facet_registry.hpp +++ b/kapi/kapi/devices/facet_registry.hpp @@ -150,7 +150,7 @@ namespace kapi::devices //! @param device The device to publish the facet for. //! @param name A stable name for the device. template - auto publish(kstd::shared_ptr device, kstd::string name) -> kstd::result + [[nodiscard]] auto publish(kstd::shared_ptr device, kstd::string name) -> kstd::result { if (!device) { @@ -172,7 +172,8 @@ namespace kapi::devices //! @param name A stable name for the device. //! @param facet The implementation of the facet for the device. template - auto publish(kstd::shared_ptr device, kstd::string name, FacetType * facet) -> kstd::result + [[nodiscard]] auto publish(kstd::shared_ptr device, kstd::string name, FacetType * facet) + -> kstd::result { return do_publish(device, std::move(name), FacetType::id, facet); } @@ -254,8 +255,8 @@ namespace kapi::devices //! @param name A stable name for the device. //! @param id The id of the facet to be published for the device. //! @param facet The facet of the device. - auto do_publish(kstd::shared_ptr device, kstd::string name, kapi::capabilities::facet_id id, void * facet) - -> kstd::result; + [[nodiscard]] auto do_publish(kstd::shared_ptr device, kstd::string name, kapi::capabilities::facet_id id, + void * facet) -> kstd::result; //! Notify all subscribed observers about a new facet having been published for a device. //! diff --git a/kapi/kapi/devices/power.hpp b/kapi/kapi/devices/power.hpp index 44837a65..a87ebc78 100644 --- a/kapi/kapi/devices/power.hpp +++ b/kapi/kapi/devices/power.hpp @@ -21,7 +21,7 @@ namespace kapi::devices //! //! @param root The root of the tree to suspend. //! @return nothing on success, the first error to occur otherwise. - auto suspend_tree(bus & root) -> kstd::result; + [[nodiscard]] auto suspend_tree(bus & root) -> kstd::result; //! Resume a device (sub-)tree rooted in a given bus. //! -- cgit v1.2.3