3 ms·
> match both the entire value and the sub-values I see. Yes, it appears to be either-or for now. > `ref` is what you'd use in a pattern though Not in the pat
by kevincox 6y ago
> match both the entire value and the sub-values
I see. Yes, it appears to be either-or for now.
> `ref` is what you'd use in a pattern though
Not in the pattern, in the "argument". Like this: https://rust.godbolt.org/z/eT366s https://rust.godbolt.org/z/eT366s
pub fn f(v: &Option<String>) {
match &v {
other => eprintln!("Doesn't move {:?}", other),
}
}