Skip to content

1.0.0

Compare
Choose a tag to compare
@bodil bodil released this 24 Feb 17:26
· 3 commits to master since this release

CHANGED

  • smartstring now implements its own boxed string type rather than deferring directly to String, so it no longer makes assumptions it shouldn't be making about the layout of the String 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 as mips.

    We are now also explicitly allocating heap memory aligned for u16 rather than u8, 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 with String, so if you were relying on that despite the documentation urging you not to, you'll really have to stop it now. Converting between SmartString and String using From and Into 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.