Why can I start a slice past the end of a vector in Rust?

后端 未结 0 443
遥遥无期
遥遥无期 2021-02-06 09:50

Given v = vec![1,2,3,4], why does v[4..] return an empty vector, but v[5..] panics, while both v[4] and v[5] pan

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