I'm struggling coming up with trait bounds for a generic function. I'm trying to write a function that takes types that can be converted to a Value. Value implements From for a couple of types. Is there a way to specify this so the following example would work or is there a better way to do this?
fn convert_to_value<T: ???>(to_convert: T) -> Value {
Value::from(to_convert)
}
to expand on this everything implementing From has automatically an Into implementation however some types can't implement From but have a Into implementation. I run into this once or twice i think it had to do with the 'orphan rule' .
True since a half year or so rust got a update witch allows at least most of this cases but at the point i was running into this problems it was still a thing