Conversation
There was a problem hiding this comment.
Do we want to encourage using scopes to contain RefCell borrows, or is it better to encourage the use of drop() on the borrowed Ref? We need scopes for &mut, but drop() is sufficient for Ref.
There was a problem hiding this comment.
I like the visual aspect of the new scope.
There was a problem hiding this comment.
Perhaps, but there are definitely cases where drop() is more useful. The question is, do we want to suggest to readers that the scope is necessary here, like it is with &mut, or do we want to show them that drop() works?
I'm ok with either answer, I just want to make sure it's an intentional choice.
There was a problem hiding this comment.
I don't care strongly but I'll rationalize this choice as: blocks are the more fundamental way for handling value lifetimes; they are built into the language, so they are more appropriate for demonstrating basic concepts.
|
Overall this is pretty good. r=me with comments. |
changelog: none
Includes module docs for
cell.