Skip to content

Commit 0120c3a

Browse files
authored
Further clarification on the benefits of passing in immutable slices to functions
1 parent a637487 commit 0120c3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

en/src/collections/vector.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn main() {
113113
### Slicing
114114
Immutable or mutable slices of Vecs can be taken, using `&` or `&mut, respectively.
115115

116-
In Rust, it’s more common to pass immutable slices as arguments rather than vectors when you just want to provide read access. The same goes for `String` and `&str`.
116+
In Rust, it’s more common to pass immutable slices as arguments rather than vectors when you just want to provide read access, as this is more flexible (no move) and efficient (no copy). The same goes for `String` and `&str`.
117117

118118
5. 🌟🌟
119119
```rust,editable

0 commit comments

Comments
 (0)