-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Hello, guys!
What do you think about adding a more thorough description with some custom drop logic, rather than just println!("> Dropping {}", self.name);?
There was a related issue: rust-lang/book#4181 (comment)
TLDR: my main idea is to provide something more obvious than just println!("Dropping CustomSmartPointer with data {}!", self.data);. For instance, when we are talking about files, the current book chapter states that "...lets you customize what happens when a value is about to go out of scope.", but it doesn't really show any customization behavior. So I thought it might be helpful for newcomers to see that drop() could be useful when working with fixtures, so you don't need to write a function fn clear_data() and call it manually after every test - you can just extend drop behavior.