cj-path-util 0.3.0

Utilities to make working with Path/PathBuf more productive
Documentation

Utilities to make working with Path/PathBuf more productive

AppendToPath

Append a subpath to a path, while re-using the left hand side as much as possible.

use cj_path_util::path_util::AppendToPath;

let left = PathBuf::from("foo");
// Copy `left`
let whole = (&left).append("bar");
// Consume and re-use memory of `left`
let whole2 = left.append("bar");

FixupPath

Replace the "" path with ".", i.e. always yield a valid path on Unix.

use cj_path_util::unix::fixup_path::FixupPath;

let left = PathBuf::from("foo");
// Copy `left`
let whole = (&left).append("bar");
// Consume and re-use memory of `left`
let whole2 = left.append("bar");

Unstable polyfill

Provides functions that currently are, or have recently been, unstable, like add_extension.

Temporary file utils

More composable/controllable utilities for handling temporary files. Currently requires the 'unix' feature. Todo: make portable.

The complete workflow is via TempfileOptions, and yet higher are the tempfile_buffered and tempfile_unbuffered procedures, but temp_path can be called directly for a lower level.

Features

The crate has one feature: unix, which enables functionality that (currently, and presumably) only works on Unix.