Is there a short way to extract exactly one element from a `Vec`?

后端 未结 0 941
野性不改
野性不改 2020-11-28 04:20

I have a Vec and I want to extract exactly one element from it, and panic if there are any more or zero. The equivalent if I had an array would be:



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