Skip to content

A convenient macro for building PathBufs in Rust.

License

Notifications You must be signed in to change notification settings

alilleybrinker/pathbuf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A convenient macro for building PathBufs in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Languages