From 79cd5113231050182f8cb40b97131137cf180fc6 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 3 Oct 2025 09:48:13 +0000 Subject: [PATCH] client: Use a helper function to send format No functional changes, just less code. Signed-off-by: Michael Tremer --- src/client/main.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/client/main.c b/src/client/main.c index 304abdc..b86edc7 100644 --- a/src/client/main.c +++ b/src/client/main.c @@ -154,21 +154,7 @@ static int render(collecty_client_ctx* ctx) { // Is available, add the desired output format if (ctx->format) { - r = sd_bus_message_open_container(m, 'e', "sv"); - if (r < 0) - goto ERROR; - - // Add key - r = sd_bus_message_append(m, "s", "format"); - if (r < 0) - goto ERROR; - - // Add the value - r = sd_bus_message_append(m, "v", "s", ctx->format); - if (r < 0) - goto ERROR; - - r = sd_bus_message_close_container(m); + r = sd_bus_message_append(m, "{sv}", "format", "s", ctx->format); if (r < 0) goto ERROR; } -- 2.47.3