arrayvec icon indicating copy to clipboard operation
arrayvec copied to clipboard

added ArrayVecCopy

Open pYtoner opened this issue 4 years ago • 7 comments

Made a copy of ArrayVec (ArrayVecCopy) that can only hold Copy items.

This means copying all of its relevant functions and relevant tests.

Closes https://github.com/bluss/arrayvec/issues/32

pYtoner avatar Jul 17 '21 16:07 pYtoner

Looks to be in the right direction, that's nice - I'll be a bit unreachable during the summer, but back in a bit

bluss avatar Jul 19 '21 00:07 bluss

Ok great, ArrayVecImpl has made it possible to share some core code. Any other ideas for how to share more? This is quite a lot of code to duplicate, even of probably half of it is necessary.

bluss avatar Nov 08 '21 20:11 bluss

Nice to see you are back. I will do the changes to make it better. This was more of a quick workaround for those needing this badly... I'll think of some ways to minimize code duplication too.

pYtoner avatar Nov 09 '21 14:11 pYtoner

Doing this with a macro would be the easiest way to remove loads of code duplication. Is that something you think would be acceptable for this crate? (Some people don't like macros 😅)

pYtoner avatar Nov 09 '21 15:11 pYtoner

Hi. Please use rebase and not merge to update the PR. Sorry I've been away from github a lot. Macros are ok, I like them, also wrote some eyesore ones myself. Now it's hard to judge in every case, but let's say that we want method bodies to be easy to read. I wouldn't put a whole module's worth of code through 1 macro, maybe it can be per method (or group of smaller trait impls).

bluss avatar Nov 09 '21 18:11 bluss

I am not sure what I did to my repo I am going to start over.

pYtoner avatar Nov 10 '21 12:11 pYtoner

Don't worry. I think you could have force-pushed to your PR branch if you wanted. Doesn't matter so much now.

bluss avatar Nov 16 '21 19:11 bluss