Rust: nested method calls with existing mutable references

前端 未结 0 1608
无人及你
无人及你 2020-12-28 19:19

The following code compiles successfully:

let mut v = vec![1];
let r = &mut v;
r.push(r.len());

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