Hacker GitHub

← All repos

ParkMyCar/compact_str

View on GitHub ↗ ★ 882 Rust

A memory efficient string type that can store up to 24* bytes on the stack

3 mentions on Hacker News by 3 people: 0 stories, 3 comments · first 2022-06-25 · latest 2025-09-12

Mentions per year 3 mentions · busiest year 2022 (1)
20082026
  1. …otherwise it is stored on the heap (with a pointer, a length, and a capacity - also 24 bytes) https://github.com/ParkMyCar/compact_str How cool is that (Discussed here https://news.ycombinator.com/item?id=41339224 )
    comment by nextaccountic · 2025-09-12 · in UTF-8 is a brilliant design
  2. …with actual string data. There's a nice explanation on their readme[2]. Love tricks like this. [1]: https://github.com/ParkMyCar/compact_str [2]: https://github.com/ParkMyCar/compact_str?tab=readme-ov-file#...
  3. https://github.com/ParkMyCar/compact_str https://old.reddit.com/r/rust/comments/t33hxp/announcing_com...