id_sys 0.1.0

Provides data structures which can be marked such that they only work with similarly marked integer data types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::internal::unqualified_type_name;
use std::{any::type_name, fmt, fmt::Formatter};

pub fn fmt_marker_name<TMarker: ?Sized>(f: &mut Formatter) -> fmt::Result {
    if f.alternate() {
        let type_name = type_name::<TMarker>();
        f.write_str(type_name)
    } else {
        let type_name = unqualified_type_name::<TMarker>();
        f.write_str(&type_name)
    }
}