Improved examples on Vec documentation

- shrink_to_fit example is now more clear by asserting the capacity value
Add @thestinger comment explaining that shrink_to_fit might drop down as close as possible but not to the minimun
auto merge of #18254 : areski/rust/pr-fix-vec-doc-example, r=alexcrichton

- shrink_to_fit example is now more clear by asserting the capacity value
- annotation [0, mid) changed for [0, mid]