pub fn to_name<T, S>(data: T, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer,
    T: Serialize