So I have a function called cr where I want the generic T to be serde_json::Value by default. How can I do this?
fn main() {
cr()
}
fn cr<T = serde_json::Value>() {
}
I get this error: cannot infer type for type parameter T declared on the function cr while calling cr. And on cr function I get this error: defaults for type parameters are only allowed in struct, enum, type, or trait definitions.