amethyst / sheep

Modular and lightweight spritesheet packer 🐑
Other
89 stars 12 forks source link

Named format uses `Vec<String>` instead of `&[String]` #13

Open Benjamin-L opened 5 years ago

Benjamin-L commented 5 years ago

Currently, AmethystNamedFormat takes extra options in the form Vec<String>. This is suboptimal since it requires moving the whole container and cloning it if it needs to be reused. Instead it could be &[String], or even &[S] with AmethystNamedFormat<S> where S: Deref<Target=str>.

I'm happy to write up a PR for this if people think it's a good idea.

basil-cow commented 5 years ago

@Benjamin-L correct me if I'm wrong, but I believe it's impossible without GAT's, since &[String] require lifetime specifier and you can't have generic parameters in type =

Benjamin-L commented 4 years ago

Oh, I think you're right about this. Should I leave the issue open for when GAT's get implemented?