sheep icon indicating copy to clipboard operation
sheep copied to clipboard

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

Open Benjamin-L opened this issue 4 years ago • 2 comments

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.

Benjamin-L avatar Jul 24 '19 18:07 Benjamin-L

@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 =

basil-cow avatar Jul 31 '19 12:07 basil-cow

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

Benjamin-L avatar Aug 19 '20 13:08 Benjamin-L