book icon indicating copy to clipboard operation
book copied to clipboard

Show the implementation of std::mem::drop in Chapter 15.3

Open AndreJesusBrito opened this issue 6 months ago • 0 comments

When the chapter 15.3 introduces the drop function we should show the implementation:

pub fn drop<T>(_x: T) {}

In my option this helps to better understand the difference between c.drop() and drop(c), showing that the "magic" is just the function taking ownership of the value.

Also a bonus: it flexes on the elegance of Rust 😉

AndreJesusBrito avatar Apr 26 '25 22:04 AndreJesusBrito