mirror of
https://github.com/rust-lang/rust
synced 2024-10-16 21:43:43 +00:00
20f6aa1365
Change Vec examples to not assert exact capacity except where it is guaranteed It was [brought up on discord](https://discord.com/channels/273534239310479360/818964227783262209/1107633959329878077) that the `Vec::into_boxed_slice` example contradicted the `Vec::with_capacity` docs in that the returned `Vec` might have _more_ capacity than requested. So, to reduce confusion change all the `assert_eq!(vec.capacity(), _)` to `assert!(vec.capacity() >= _)`, except in 4 examples that have guaranteed capacities: `Vec::from_raw_parts`, `Vec::from_raw_parts_in`, `Vec::<()>::with_capacity`,`Vec::<(), _>::with_capacity_in`. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |