| Crates.io | pathbuf |
| lib.rs | pathbuf |
| version | 1.0.0 |
| created_at | 2023-01-13 03:06:30.712376+00 |
| updated_at | 2024-01-02 20:30:43.020639+00 |
| description | A macro to conveniently build PathBufs |
| homepage | |
| repository | https://github.com/alilleybrinker/pathbuf |
| max_upload_size | |
| id | 757579 |
| size | 15,891 |
pathbufpathbuf is a simple crate which provides the pathbuf macro to
conveniently construct the Rust PathBuf type.
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);
}
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.