smallstring 0.1.2

'Small string' optimization: store small strings on the stack using smallvec
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 6.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.77 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • jFransham/smallstring
    44 7 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jackpot51 eira-fransham

Small String

Create strings of any length on the stack, automatically upgrading to the heap when they become larger than the buffer. Also allows converting from a String for free (i.e. without copying to the stack even if they're small enough).

Backed by smallvec.

// Default maximum size to store on the stack: 8 bytes
let stack: SmallString = "Hello!".into();

// Reuses allocation
let heap: String = "Hello!".into();
let still_heap: SmallString = heap.into();