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