From 31cc4b3df07b809a6e9ac601cb097c044aefbf5a Mon Sep 17 00:00:00 2001 From: Jack Mac Date: Tue, 21 Sep 2021 12:46:17 -0400 Subject: [PATCH] switched to using usings --- imgui/src/lib.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/imgui/src/lib.rs b/imgui/src/lib.rs index 929636e..d453a88 100644 --- a/imgui/src/lib.rs +++ b/imgui/src/lib.rs @@ -4,12 +4,7 @@ pub extern crate imgui_sys as sys; -use std::cell; -use std::ffi::CStr; use std::os::raw::{c_char, c_void}; -use std::ptr; -use std::str; -use std::thread; pub use self::clipboard::*; pub use self::color::ImColor32; @@ -96,8 +91,8 @@ pub use core as __core; #[doc(alias = "GetVersion")] pub fn dear_imgui_version() -> &'static str { unsafe { - let bytes = CStr::from_ptr(sys::igGetVersion()).to_bytes(); - str::from_utf8_unchecked(bytes) + let bytes = std::ffi::CStr::from_ptr(sys::igGetVersion()).to_bytes(); + std::str::from_utf8_unchecked(bytes) } } @@ -122,9 +117,9 @@ impl Context { #[derive(Debug)] pub struct Ui<'ui> { ctx: &'ui Context, - font_atlas: Option>, + font_atlas: Option>, // imgui isn't mutli-threaded -- so no one will ever access twice. - buffer: cell::UnsafeCell, + buffer: std::cell::UnsafeCell, } impl<'ui> Ui<'ui> { @@ -199,7 +194,7 @@ impl<'ui> Ui<'ui> { impl<'a> Drop for Ui<'a> { #[doc(alias = "EndFrame")] fn drop(&mut self) { - if !thread::panicking() { + if !std::thread::panicking() { unsafe { sys::igEndFrame(); } @@ -246,7 +241,7 @@ impl<'ui> Ui<'ui> { /// Renders a style editor block (not a window) for the currently active style #[doc(alias = "ShowStyleEditor")] pub fn show_default_style_editor(&self) { - unsafe { sys::igShowStyleEditor(ptr::null_mut()) }; + unsafe { sys::igShowStyleEditor(std::ptr::null_mut()) }; } /// Renders a basic help/info block (not a window) #[doc(alias = "ShowUserGuide")]