From 0e08c743b89aa76d0a1566ea34b2ebf49d072231 Mon Sep 17 00:00:00 2001 From: not manx Date: Tue, 4 Aug 2020 21:03:22 +0100 Subject: [PATCH] Use silly hack to remove macro case --- src/sys/user.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/sys/user.rs b/src/sys/user.rs index 26d836a..f964b45 100644 --- a/src/sys/user.rs +++ b/src/sys/user.rs @@ -26,17 +26,7 @@ pub fn get_users() -> std::vec::Vec { let mut users = vec!(); unsafe { - // This could maybe be simplified but there's no point macro_rules! from_cstr { - ($x:expr, $fmt:literal) => { - match std::ffi::CStr::from_ptr($x).to_owned().into_string() { - Ok(v) => v, - Err(v) => { - warn!($fmt, v); - continue; - } - } - }; ($x:expr, $fmt:literal, $usr:expr) => { match std::ffi::CStr::from_ptr($x).to_owned().into_string() { Ok(v) => v, @@ -60,7 +50,8 @@ pub fn get_users() -> std::vec::Vec { let my_passwd = *passwd; let name = from_cstr!( my_passwd.pw_name, - "User {} has invalid UTF-8 characters, skipping" + "{}User {} has invalid UTF-8 characters, skipping", + "" // Lol ); users.push(Passwd{