forked from AbleOS/ableos
19 lines
242 B
Rust
19 lines
242 B
Rust
//! Small generic utilities
|
|
//!
|
|
//!
|
|
//!
|
|
|
|
pub fn type_of<T>(_: &T) -> &str {
|
|
core::any::type_name::<T>()
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
|
|
// #[test]
|
|
fn test_type_of() {
|
|
assert_eq!(type_of(&1), "i32");
|
|
}
|
|
}
|