fuzzysearch icon indicating copy to clipboard operation
fuzzysearch copied to clipboard

new type for targets

Open tpam28 opened this issue 5 years ago • 2 comments

Hello everyone. I want to ask you why this library uses string type for targets, not a Stringer interface or other. I think devs more often have to search in a slice of objects than in an array of raw strings. I suppose that this change type for targets will be useful.

tpam28 avatar Nov 26 '20 13:11 tpam28

No particular reason. It seemed obvious at the time. It's a shame string doesn't implement Stringer, otherwise it would be an easy thing to change 🤷‍♂️ Now it would be a backwards-incompatible change, which I'm not super keen on making.

I will consider adding a new set of functions that mirror the existing ones but accepts Stringer instead of string though 🤔

lithammer avatar Dec 01 '20 16:12 lithammer

I'd say that probably new a set of functions maybe looks a boilerplate code. I suggest thinking about a creation v2 package version includes incompatible change.
Anyway, thank you for paying attention to this topic.

tpam28 avatar Dec 01 '20 20:12 tpam28