1 unstable release
0.1.0 | Jan 22, 2025 |
---|
#1311 in Filesystem
113 downloads per month
14KB
195 lines
Reusable directory buffers.
This library implements a simple DirBuf
type in order to
easily perform a simple optimization: re-using a heap buffer
when opening multiple files in a single dir.
consider this example:
// allocation 1
let data_dir = get_my_app_data_dir();
// allocation 2
let config_a = data_dir.join("a.conf");
// allocation 3
let config_b = data_dir.join("b.conf");
// allocation 3
let config_c = data_dir.join("c.conf");
let config_d = data_dir.join("d.conf");
Using DirBuf
allows you to implement this pattern while only using a single allocation.
Dependencies
~245–700KB
~16K SLoC