diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2024-12-15 20:01:38 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-15 20:01:38 +1100 |
| commit | b9741879509e2ca0c10477f01b07b997e6cbd8e0 (patch) | |
| tree | 90549834e46e8016aef59aac2d72531aae8a5f55 /tests/coverage/branch/lazy-boolean.coverage | |
| parent | d48af09ffd173fd87136d41033665bcf23ea251c (diff) | |
| parent | 6d5c59140540bae68615f892288eea985b5a4af2 (diff) | |
| download | rust-b9741879509e2ca0c10477f01b07b997e6cbd8e0.tar.gz rust-b9741879509e2ca0c10477f01b07b997e6cbd8e0.zip | |
Rollup merge of #134310 - tkr-sh:master, r=Noratrieb
Add clarity to the examples of some `Vec` & `VecDeque` methods In some `Vec` and `VecDeque` examples where elements are `i32`, examples can seem a bit confusing at first glance if a parameter of the method is an `usize`. In this case, I think it's better to use `char` rather than `i32`. > [!NOTE] > It's already done in the implementation of `VecDeque::insert` #### Difference - `i32` ```rs let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); assert_eq!(v, [1, 3]); ``` - `char` ```rs let mut v = vec!['a', 'b', 'c']; assert_eq!(v.remove(1), 'b'); assert_eq!(v, ['a', 'c']); ``` Even tho it's pretty minor, it's a nice to have.
Diffstat (limited to 'tests/coverage/branch/lazy-boolean.coverage')
0 files changed, 0 insertions, 0 deletions
