Why does calling a method on a variable prevent Rust from inferring the type of the variable?

前端 未结 0 1557
日久生厌
日久生厌 2021-02-11 16:51

This code compiles:

#[derive(Debug, Default)]
struct Example;

impl Example {
    fn some_method(&self) {}
}

fn reproduction() -> Example {
    let examp         


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