From aa0e242a7a91308b82f0e2b5f81fe9ad8b15a079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?joseLu=C3=ADs?= Date: Wed, 5 May 2021 20:34:04 +0200 Subject: [PATCH] [rust] bugfix & a couple of minor updates --- rust/src/macros.rs | 2 +- rust/src/visual/methods.rs | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/rust/src/macros.rs b/rust/src/macros.rs index 559645fef..b3b38d01a 100644 --- a/rust/src/macros.rs +++ b/rust/src/macros.rs @@ -205,7 +205,7 @@ macro_rules! error_ref_mut { #[macro_export] macro_rules! error_str { ($str:expr, $msg:expr) => { - if $str.is_null() { + if !$str.is_null() { #[allow(unused_unsafe)] return Ok(unsafe { (&*$str).to_string() }); } else { diff --git a/rust/src/visual/methods.rs b/rust/src/visual/methods.rs index c4f6d2e0a..769abf85d 100644 --- a/rust/src/visual/methods.rs +++ b/rust/src/visual/methods.rs @@ -118,7 +118,10 @@ impl NcVisual { cols as i32, ) }, - "NcVisual::from_bgra()" + &format![ + "NcVisual::from_bgra(bgra, {}, {}, {})", + rows, rowstride, cols + ] ] } @@ -163,7 +166,7 @@ impl NcVisual { ) }, &format!( - "NcVisual::from_file({}, {}, {}, {}, {})", + "NcVisual::from_file(plane, {}, {}, {}, {}, {})", blitter, beg_y, beg_x, len_y, len_x ) ] @@ -195,7 +198,10 @@ impl NcVisual { cols as i32, ) }, - &format!("NcVisual::from_rgba({}, {}, {})", rows, rowstride, cols) + &format!( + "NcVisual::from_rgba(rgba, {}, {}, {})", + rows, rowstride, cols + ) ] }