ebassi / taglib-rust

TagLib bindings for Rust
MIT License
27 stars 11 forks source link

Added File::from_path which shadows File::new #6

Closed pinkisemils closed 6 years ago

pinkisemils commented 6 years ago

This allows one to create new TagLib::File structs from whatever implements AsRef<std::path::Path>.

cdown commented 6 years ago

Hey! Thanks for the patch. As it is, I'm not entirely certain this does what you intended, as there's no implentation of From<Path> for Vec<u8>. Could you add a test showing your intended use?

This also duplicates a lot of code from new, which seems non-ideal (new_type is also guilty of this, but I plan to fix that).

This should be fairly simple to do while reusing code. I'll take a look.

cdown commented 6 years ago

4ac35595cf338b0e71fe8bec9a365bc54c3b2cf5 does this just by extending main.