Skip to content

Commit

Permalink
Remove ye ol' deprecated im_str! marco
Browse files Browse the repository at this point in the history
  • Loading branch information
dbr committed Nov 29, 2022
1 parent 7cc7bf9 commit 54f4bef
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions imgui/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,36 +74,6 @@ impl UiBuffer {
}
}

#[macro_export]
#[deprecated = "all functions take AsRef<str> now -- use inline strings or `format` instead"]
macro_rules! im_str {
($e:literal $(,)?) => {{
const __INPUT: &str = concat!($e, "\0");
{
// Trigger a compile error if there's an interior NUL character.
const _CHECK_NUL: [(); 0] = [(); {
let bytes = __INPUT.as_bytes();
let mut i = 0;
let mut found_nul = 0;
while i < bytes.len() - 1 && found_nul == 0 {
if bytes[i] == 0 {
found_nul = 1;
}
i += 1;
}
found_nul
}];
const RESULT: &'static $crate::ImStr = unsafe {
$crate::__core::mem::transmute::<&'static [u8], &'static $crate::ImStr>(__INPUT.as_bytes())
};
RESULT
}
}};
($e:literal, $($arg:tt)+) => ({
$crate::ImString::new(format!($e, $($arg)*))
});
}

/// A UTF-8 encoded, growable, implicitly nul-terminated string.
#[derive(Clone, Hash, Ord, Eq, PartialOrd, PartialEq)]
pub struct ImString(pub(crate) Vec<u8>);
Expand Down

0 comments on commit 54f4bef

Please sign in to comment.