1 unstable release

0.1.0 Jan 22, 2025

#1311 in Filesystem

Download history 113/week @ 2025-01-22

113 downloads per month

MIT license

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