From 018020c2023442b8a8a3afd1da26f21dca42bb2d Mon Sep 17 00:00:00 2001 From: Dominik Gschwind Date: Sun, 15 Aug 2021 12:01:36 +0200 Subject: [PATCH] Add `esp_result!` version without return value arg --- src/error.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/error.rs b/src/error.rs index c2c0f763e7a..68d606c05e0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -72,6 +72,9 @@ macro_rules! esp_result { ($err:expr, $value:expr) => {{ esp_idf_sys::EspError::check_and_return($err as esp_idf_sys::esp_err_t, $value) }}; + ($err:expr) => {{ + esp_idf_sys::EspError::check_and_return($err as esp_idf_sys::esp_err_t, ()) + }}; } #[macro_export]