I just found a very strange issue. I have a type Option<&T> returned from a function, With two different way to get the type, One is compiled, another is failed with type not match
Is this a compiler bug?
Not compile
self.arr.get(0)
Compiles
if let Some(r) = self.arr.get(0) {
Some(r)
} else {
None
}