grpc/
misc.rs

1use std::any::Any;
2
3pub fn _any_to_string(any: Box<dyn Any + Send + 'static>) -> String {
4    if any.is::<String>() {
5        *any.downcast::<String>().unwrap()
6    } else if any.is::<&str>() {
7        (*any.downcast::<&str>().unwrap()).to_owned()
8    } else {
9        "unknown any".to_owned()
10    }
11}