Why does Rust not infer this closure's return type?

后端 未结 0 717
深忆病人
深忆病人 2021-01-15 04:41

The Rust compiler is usually able to infer the type of an expression that is returned from a closure:

fn main() {
    let a_closure = |num|{
        num+1.0
          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题