Closed dpc closed 5 years ago
Rope
implements From<RopeSlice>
, so you can just do my_rope.slice(a..b).into()
.
More generally, both Rope
and RopeSlice
have many useful standard library trait implementations that let you accomplish things like this efficiently, so pay attention to the impl
s. :-)
Hope this helps!
That helps a lot! Thank you!
For implementing copy-paste, it is useful to take part of the
Rope
, as a newRope
. Right now I will just have toclone()
and remove prefix and suffix, which is not too bad, but not ideal. :)