whitfin / runiq

An efficient way to filter duplicate lines from input, à la uniq.
MIT License
209 stars 23 forks source link

runiq as a library? #16

Closed Uinelj closed 10 months ago

Uinelj commented 3 years ago

Hi,

I've been using as a library to be able to provide multiple filter implementations depending on context, and while forking the reposity I noticed the following lines in the main.rs file:

//! Runiq is only built as a command line tool, although it may be
//! distributed as a core crate if the backing implementation becomes
//! interesting for other use cases.

While I'm currently happy with my solution, I wonder if it would benefit people to integrate changes in the project so that runiq could be used both as a deduplication tool and library.

runiq commented 2 years ago

This may sound weird coming from me, but… yeah, I'd also like this.

Uinelj commented 2 years ago

The repository seems to be stale, and the author has not responded to issues for a long time 😢

I uploaded my fork (only adding lib access support) on crates.io, using the name runiq-lib. I do not (currently) plan on improving anything besides enabling lib access, though.

whitfin commented 2 years ago

I wouldn't call it stale, more that there's nothing time sensitive that needs doing.

What are the use cases where you would use this as a library, and what sort of interface would you expect?

Uinelj commented 2 years ago

Yep, stale was not the best choice of words, I apologize!

My use case is pretty simple: I use the Filter trait and its implementations to deduplicate data. I've been looking for high performance implementations. Using runiq as a library makes it easy to integrate high performance implementations while enabling the API user to define its own filters in a compatible manner.

whitfin commented 10 months ago

Hi @Uinelj + @runiq!

I know this is waaaaay late, but I finally got some time to put some love back into this repository and just wanted to let you know that as of v2.0.0 you will be able to use the Filter trait and all implementations directly as a library.

Sorry for taking so long, but hopefully better late than never?

runiq commented 10 months ago

My name is @runiq and I approve of this release :tada: