But lifetimes mean implementing Deref is a pain, so I can't share methods between the two like String and str unless I dabble in some unsafe code, which really isn't worth the trouble right now...
I could revisit this at some point in the future if I want to reduce the copying being done. It's also worth noting that crates automating method delegation could cut down a bit on method duplication if I skip implementing Deref.
I tried to avoid copying data by creating a
SubSeq
type:But lifetimes mean implementing
Deref
is a pain, so I can't share methods between the two likeString
andstr
unless I dabble in someunsafe
code, which really isn't worth the trouble right now...I could revisit this at some point in the future if I want to reduce the copying being done. It's also worth noting that crates automating method delegation could cut down a bit on method duplication if I skip implementing
Deref
.