mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-02-04 18:36:01 +02:00
Fix typo in box.md (#2362)
This commit is contained in:
parent
5aa08d489f
commit
3637c44a5d
@ -68,8 +68,8 @@ fn main() {
|
||||
- `Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be not
|
||||
null.
|
||||
- A `Box` can be useful when you:
|
||||
- have a type whose size that can't be known at compile time, but the Rust
|
||||
compiler wants to know an exact size.
|
||||
- have a type whose size can't be known at compile time, but the Rust compiler
|
||||
wants to know an exact size.
|
||||
- want to transfer ownership of a large amount of data. To avoid copying large
|
||||
amounts of data on the stack, instead store the data on the heap in a `Box`
|
||||
so only the pointer is moved.
|
||||
|
Loading…
x
Reference in New Issue
Block a user