Hello Rustineers!
Please consider the following snippet.
use std::rc::Rc;
fn main() {
let rcnone: Rc<Option<String>> = Rc::new(None);
match rcnone {
Some(_) => panic!(),
None => println!("yep.")
}
}
Why doesn't it work? I have to explicitly match *rcnone
and not rcnone
to make it compile, but I thought the point of the dereference trait which Rc implements was to avoid having to dereferencing things?
Thanks in advance for the explanation, have a beautiful day!