2022-01-16 09:23:19 -06:00
|
|
|
//! Small generic utilities
|
|
|
|
//!
|
|
|
|
//!
|
|
|
|
//!
|
|
|
|
|
|
|
|
pub fn type_of<T>(_: &T) -> &str {
|
|
|
|
core::any::type_name::<T>()
|
|
|
|
}
|
2022-01-26 19:43:03 -06:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
// #[test]
|
|
|
|
fn test_type_of() {
|
|
|
|
assert_eq!(type_of(&1), "i32");
|
|
|
|
}
|
|
|
|
}
|