Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 645d7eb

Browse files
authored
Merge pull request #680 from dbr/rmimstr
Removing im_str! marco
2 parents 6d6cda2 + 54f4bef commit 645d7eb

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

imgui/src/string.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -74,36 +74,6 @@ impl UiBuffer {
7474
}
7575
}
7676

77-
#[macro_export]
78-
#[deprecated = "all functions take AsRef<str> now -- use inline strings or `format` instead"]
79-
macro_rules! im_str {
80-
($e:literal $(,)?) => {{
81-
const __INPUT: &str = concat!($e, "\0");
82-
{
83-
// Trigger a compile error if there's an interior NUL character.
84-
const _CHECK_NUL: [(); 0] = [(); {
85-
let bytes = __INPUT.as_bytes();
86-
let mut i = 0;
87-
let mut found_nul = 0;
88-
while i < bytes.len() - 1 && found_nul == 0 {
89-
if bytes[i] == 0 {
90-
found_nul = 1;
91-
}
92-
i += 1;
93-
}
94-
found_nul
95-
}];
96-
const RESULT: &'static $crate::ImStr = unsafe {
97-
$crate::__core::mem::transmute::<&'static [u8], &'static $crate::ImStr>(__INPUT.as_bytes())
98-
};
99-
RESULT
100-
}
101-
}};
102-
($e:literal, $($arg:tt)+) => ({
103-
$crate::ImString::new(format!($e, $($arg)*))
104-
});
105-
}
106-
10777
/// A UTF-8 encoded, growable, implicitly nul-terminated string.
10878
#[derive(Clone, Hash, Ord, Eq, PartialOrd, PartialEq)]
10979
pub struct ImString(pub(crate) Vec<u8>);

0 commit comments

Comments
 (0)