1.0.0
CHANGED
-
smartstring
now implements its own boxed string type rather than deferring directly toString
, so it no longer makes assumptions it shouldn't be making about the layout of theString
struct.This also allows us to organise the boxed struct in a way that will let us rely only on our basic assumption that heap memory is word aligned on both big and little endian architectures. The most immediate consequence of this is that
smartstring
will now compile on 32-bit big endian architectures such asmips
.We are now also explicitly allocating heap memory aligned for
u16
rather thanu8
, ensuring the assumption about pointer alignment becomes an invariant.In short:
smartstring
no longer relies on undefined behaviour, and should be safe to use anywhere. -
The above means that the boxed
SmartString
is no longer pointer compatible withString
, so if you were relying on that despite the documentation urging you not to, you'll really have to stop it now. Converting betweenSmartString
andString
usingFrom
andInto
traits is still efficient and allocation free. -
The minimum supported rustc version is now 1.57.0.
-
The
smartstring::validate()
function has been removed, as it's no longer needed.