capi: use unwrap_unchecked when we're certain a value is not null.
This commit is contained in:
parent
8ed244f6fa
commit
a6b1e0a412
|
@ -223,14 +223,14 @@ macro_rules! assert_some_ptr {
|
||||||
return $crate::error::LibrashaderError::InvalidParameter(stringify!($value)).export();
|
return $crate::error::LibrashaderError::InvalidParameter(stringify!($value)).export();
|
||||||
}
|
}
|
||||||
|
|
||||||
let $value = unsafe { $value.as_ref().unwrap().as_ref() };
|
let $value = unsafe { $value.as_ref().unwrap_unchecked().as_ref() };
|
||||||
};
|
};
|
||||||
(mut $value:ident) => {
|
(mut $value:ident) => {
|
||||||
if $value.is_none() {
|
if $value.is_none() {
|
||||||
return $crate::error::LibrashaderError::InvalidParameter(stringify!($value)).export();
|
return $crate::error::LibrashaderError::InvalidParameter(stringify!($value)).export();
|
||||||
}
|
}
|
||||||
|
|
||||||
let $value = unsafe { $value.as_mut().unwrap().as_mut() };
|
let $value = unsafe { $value.as_mut().unwrap_unchecked().as_mut() };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use std::iter::Filter;
|
|
||||||
use crate::descriptor_heap::{D3D12DescriptorHeap, D3D12DescriptorHeapSlot, SamplerPaletteHeap};
|
use crate::descriptor_heap::{D3D12DescriptorHeap, D3D12DescriptorHeapSlot, SamplerPaletteHeap};
|
||||||
use crate::error;
|
use crate::error;
|
||||||
use librashader_common::{FilterMode, WrapMode};
|
use librashader_common::{FilterMode, WrapMode};
|
||||||
|
|
Loading…
Reference in a new issue