gitignore.rs
gitignore.rs copied to clipboard
A gitignore file can't exist beyond the life of the borrowed path passed in.
pub fn new(gitignore_path: &'b Path) -> Result<File<'b>, error::Error> {
makes it impossible for the file to persist for longer than the borrowed path passed in. Like you couldn't create a function that creates its own str slice local to the function scope and return a gitignore::File because the compiler would complain that the passed in gitignore_path
would go out of scope before File
. Why not use a PathBuf or a Cow? This library seems just very limited in possible usage in its current form since it can't ever escape the scope of the path it was made with.
I think this is answered mainly in #14 as I plan to redesign most of this library to improve its usefulness. I'll keep this open for now as I think it's good to track these issues more formally - I will try to make some issues for the other issues I see in the current implementation and get my branch of work public ASAP.
HI @btipling — thanks for your issue and sorry I never got this done! After much consideration I've decided I'm going to archive this crate, about which you can read more here:
https://github.com/nathankleyn/gitignore.rs#project-status
It's a tough decision to make but I want to be realistic that the crate isn't in a good state — it needs a total overhaul to fix the kinds of issues that are being reported, but I haven't the time to commit to it. I can't reasonably handover what is here to a new maintainer, so instead I have made some recommendations in the README for crates you should consider using instead for ignoring files. Please let me know if you need assistance with migrating should you be using this crate.