pathbuf

Crates.iopathbuf
lib.rspathbuf
version1.0.0
sourcesrc
created_at2023-01-13 03:06:30.712376
updated_at2024-01-02 20:30:43.020639
descriptionA macro to conveniently build PathBufs
homepage
repositoryhttps://github.com/alilleybrinker/pathbuf
max_upload_size
id757579
size15,891
Andrew Lilley Brinker (alilleybrinker)

documentation

README

pathbuf

pathbuf is a simple crate which provides the pathbuf macro to conveniently construct the Rust PathBuf type.

Example

use pathbuf::pathbuf;
use std::path::PathBuf;

fn main() {
	let p = pathbuf!["hello", "filename.txt"];

	let expected = {
		let mut temp = PathBuf::new();
		temp.push("hello");
		temp.push("filename.txt");
		temp
	};

	assert_eq!(p, expected);
}

License

pathbuf is licensed under the Apache 2.0 license, and is itself a reproduction of the hc_pathbuf crate found in Hipcheck, pulled out into its own distinct crate for reuse.

Commit count: 8

cargo fmt