From a42dd5682542ce21dc79784ae250f6520b89cd2f Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 6 Jun 2019 15:45:03 +0200 Subject: [PATCH] remove unneeded string duplication before passing to callback --- src/dc_log.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dc_log.rs b/src/dc_log.rs index 9fdc3052a7..5b96ddec46 100644 --- a/src/dc_log.rs +++ b/src/dc_log.rs @@ -99,7 +99,7 @@ macro_rules! info { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $crate::constants::Event::INFO, $data1 as uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as uintptr_t) + formatted_c.as_ptr() as uintptr_t) } }}; } @@ -114,7 +114,7 @@ macro_rules! warn { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $crate::constants::Event::WARNING, $data1 as libc::uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as libc::uintptr_t) + formatted_c.as_ptr() as libc::uintptr_t) } }; } @@ -129,7 +129,7 @@ macro_rules! error { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $crate::constants::Event::ERROR, $data1 as uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as uintptr_t) + formatted_c.as_ptr() as uintptr_t) } }; } @@ -144,7 +144,7 @@ macro_rules! log_event { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $event, $data1 as uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as uintptr_t) + formatted_c.as_ptr() as uintptr_t) } }; }