-
-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Milestone
Description
Currently, it implements Copy, which could cause unexpected behaviors. I think it is better to just implement Clone, so the user can explicitly create a copy of the iterator.
This is also the reason why Range from std lib doesn't implement Copy, even though the underlying type implements copy.
Example:
let mut text_start = text_end;
text_start.backward_line();Does text_end also move backward a line? (Spoiler: it does not, since it is creating a copy behind the scenes)
let mut text_start = text_end.clone();
text_start.backward_line();Here, it is explicit that we are making a deep copy of the text_end.
Metadata
Metadata
Assignees
Labels
No labels