Closed alexpovel closed 1 year ago
Noble goal, but with this method and its const
nature:
https://github.com/alexpovel/b4s/blob/7bbbbe2b43ccfb2a76bca3d092ac20379da32ca5/src/lib.rs#L461-L463
one cannot have String
at compile time, as it's heap allocated. RIP. The impact should be minimal though.
It's easiest for data structures to own their constituents. Makes sense. Structs holding references propagate the resulting, special lifetime requirement all the way up to each user. It's almost like
struct
colouring, the wayasync
leads to function colouring in languages like Python.In that sense, it would be nice for
SortedString
to hold aString
, not a&str
. Would make working with it much easier. Technically it's unnecessary as all we need is a readonly view into the string though...