add nullary type_name debug util
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -84,10 +84,13 @@ pub fn trap() {
|
|||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn panic_str(p: &Box<dyn Any + Send>) -> &'static str { p.downcast_ref::<&str>().copied().unwrap_or_default() }
|
pub fn panic_str(p: &Box<dyn Any + Send>) -> &'static str { p.downcast_ref::<&str>().copied().unwrap_or_default() }
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn type_name<T>(_: &T) -> &'static str { std::any::type_name::<T>() }
|
pub fn rttype_name<T>(_: &T) -> &'static str { type_name::<T>() }
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
#[must_use]
|
||||||
|
pub fn type_name<T>() -> &'static str { std::any::type_name::<T>() }
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
Reference in New Issue
Block a user