Derive the table name from the type name.
()
| 89 | |
| 90 | /// Derive the table name from the type name. |
| 91 | fn table_name<T: ?Sized>() -> &'static str { |
| 92 | let full = std::any::type_name::<T>(); |
| 93 | let name = full.rsplit_once("::").map(|x| x.1).unwrap(); |
| 94 | assert!(name.chars().all(|c| c.is_ascii_alphanumeric())); |
| 95 | assert!(!name.is_empty()); |
| 96 | name |
| 97 | } |
| 98 | |
| 99 | // Make sure that `RawTable` remains object safe. |
| 100 | #[allow(unused)] |
nothing calls this directly
no outgoing calls
no test coverage detected