mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-10 21:18:36 +00:00
fixup: remove redundant unsafe scope
This commit is contained in:
parent
1d06e2c049
commit
beccfa89ec
@ -60,8 +60,8 @@ impl DrawData {
|
||||
return &[];
|
||||
}
|
||||
slice::from_raw_parts(
|
||||
self.cmd_lists as *const *const DrawList,
|
||||
self.cmd_lists_count as usize
|
||||
self.cmd_lists as *const *const DrawList,
|
||||
self.cmd_lists_count as usize,
|
||||
)
|
||||
}
|
||||
/// Converts all buffers from indexed to non-indexed, in case you cannot render indexed
|
||||
@ -149,16 +149,14 @@ impl RawWrapper for DrawList {
|
||||
impl DrawList {
|
||||
#[inline]
|
||||
pub(crate) unsafe fn cmd_buffer(&self) -> &[sys::ImDrawCmd] {
|
||||
unsafe {
|
||||
if self.0.CmdBuffer.Size <= 0 || self.0.CmdBuffer.Data.is_null() {
|
||||
return &[];
|
||||
}
|
||||
|
||||
slice::from_raw_parts(
|
||||
self.0.CmdBuffer.Data as *const sys::ImDrawCmd,
|
||||
self.0.CmdBuffer.Size as usize,
|
||||
)
|
||||
if self.0.CmdBuffer.Size <= 0 || self.0.CmdBuffer.Data.is_null() {
|
||||
return &[];
|
||||
}
|
||||
|
||||
slice::from_raw_parts(
|
||||
self.0.CmdBuffer.Data as *const sys::ImDrawCmd,
|
||||
self.0.CmdBuffer.Size as usize,
|
||||
)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user