mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-24 20:08:31 +00:00
Fix a couple missed clippy issues
This commit is contained in:
parent
3a1aa3a684
commit
fde0336af2
@ -100,7 +100,7 @@ fn test_imvec2_memory_layout() {
|
|||||||
assert_eq!(mem::align_of::<ImVec2>(), mem::align_of::<[f32; 2]>());
|
assert_eq!(mem::align_of::<ImVec2>(), mem::align_of::<[f32; 2]>());
|
||||||
let test = ImVec2::new(1.0, 2.0);
|
let test = ImVec2::new(1.0, 2.0);
|
||||||
let ref_a: &ImVec2 = &test;
|
let ref_a: &ImVec2 = &test;
|
||||||
let ref_b: &[f32; 2] = unsafe { mem::transmute(&test) };
|
let ref_b: &[f32; 2] = unsafe { &*(&test as *const _ as *const [f32; 2]) };
|
||||||
assert_eq!(&ref_a.x as *const _, &ref_b[0] as *const _);
|
assert_eq!(&ref_a.x as *const _, &ref_b[0] as *const _);
|
||||||
assert_eq!(&ref_a.y as *const _, &ref_b[1] as *const _);
|
assert_eq!(&ref_a.y as *const _, &ref_b[1] as *const _);
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ fn test_imvec4_memory_layout() {
|
|||||||
assert_eq!(mem::align_of::<ImVec4>(), mem::align_of::<[f32; 4]>());
|
assert_eq!(mem::align_of::<ImVec4>(), mem::align_of::<[f32; 4]>());
|
||||||
let test = ImVec4::new(1.0, 2.0, 3.0, 4.0);
|
let test = ImVec4::new(1.0, 2.0, 3.0, 4.0);
|
||||||
let ref_a: &ImVec4 = &test;
|
let ref_a: &ImVec4 = &test;
|
||||||
let ref_b: &[f32; 4] = unsafe { mem::transmute(&test) };
|
let ref_b: &[f32; 4] = unsafe { &*(&test as *const _ as *const [f32; 4]) };
|
||||||
assert_eq!(&ref_a.x as *const _, &ref_b[0] as *const _);
|
assert_eq!(&ref_a.x as *const _, &ref_b[0] as *const _);
|
||||||
assert_eq!(&ref_a.y as *const _, &ref_b[1] as *const _);
|
assert_eq!(&ref_a.y as *const _, &ref_b[1] as *const _);
|
||||||
assert_eq!(&ref_a.z as *const _, &ref_b[2] as *const _);
|
assert_eq!(&ref_a.z as *const _, &ref_b[2] as *const _);
|
||||||
|
|||||||
@ -388,7 +388,7 @@ fn test_shared_font_atlas() {
|
|||||||
let _guard = crate::test::TEST_MUTEX.lock();
|
let _guard = crate::test::TEST_MUTEX.lock();
|
||||||
let atlas = Rc::new(RefCell::new(SharedFontAtlas::create()));
|
let atlas = Rc::new(RefCell::new(SharedFontAtlas::create()));
|
||||||
let suspended1 = SuspendedContext::create_with_shared_font_atlas(atlas.clone());
|
let suspended1 = SuspendedContext::create_with_shared_font_atlas(atlas.clone());
|
||||||
let mut ctx2 = Context::create_with_shared_font_atlas(atlas.clone());
|
let mut ctx2 = Context::create_with_shared_font_atlas(atlas);
|
||||||
{
|
{
|
||||||
let _borrow = ctx2.fonts();
|
let _borrow = ctx2.fonts();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::float_cmp)]
|
||||||
pub extern crate imgui_sys as sys;
|
pub extern crate imgui_sys as sys;
|
||||||
|
|
||||||
use std::cell;
|
use std::cell;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user