1 unstable release
Uses old Rust 2015
0.1.0 | Nov 14, 2015 |
---|
#1892 in Rust patterns
298,816 downloads per month
Used in 267 crates
(2 directly)
11KB
255 lines
StrStack
A string allocation library. This is primarily useful when you want to allocate a bunch of small strings, use them, and then destroy them all together.
Documentation
https://stebalien.github.com/str_stack/str_stack/
Performance
- Allocation: ~2.5x speedup (for 1000 strings) (~42ns per string)
- Indexing: 0.73x speedup (slower) (~1.7ns per index)
- Iterate: 0.35x speedup (much slower) (~1ns per iteration)
lib.rs
:
A string allocation library. This is primarily useful when you want to allocate a bunch of small strings, use them, and then destroy them all together.
Example
use str_stack::StrStack;
let mut stack = StrStack::new();
let first = stack.push("one");
let second = stack.push("two");
let third = stack.push("three");
assert_eq!(&stack[first], "one");
assert_eq!(&stack[second], "two");
assert_eq!(&stack[third], "three");