#string #str #static #leak

ascend

Make static strs from any string

4 releases (2 breaking)

0.3.0 Mar 3, 2023
0.2.0 Nov 23, 2022
0.1.1 Nov 23, 2022
0.1.0 Nov 23, 2022

#280 in Caching

Unlicense

5KB
88 lines

This crate provides a function, [static_str()], which provides a static reference to a [str] by leaking it.

However, calling [static_str()] multiple times on the same string (in the same thread) will return the same string every time to save memory.

Dependencies

~220KB