linksplatform / linksplatform/doublets-rs
Unnecessary trailing Flow::Continue
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6
- Forks
- 0
- Avg merge
- 1h 37m
- Merged PRs (30d)
- 1
Description
At the moment, in any `Handler`, you need to return `Try`. This is cool and allows interrupting operations in errors.
But it inflates the code:
```rust
// one operation handler
|link| {
worker.work(link);
Continue // <- :(
}
```
But everyone wants to:
```rust
|link| worker.work(link)
```
I see two ways
---
### **1. Inspired by `std::Termination` create `Termination`-like trait**
It might look something like this:
```rust
trait HandlerResult {
type Try: Try;
fn try_it(self) -> Self::Try;
}
// impl for ()
// impl for all Try
```
### **2. Discard `Handlers' outside the internal code (track it https://github.com/linksplatform/doublets-rs/issues/3)**
Use `$OP_iter` so `each_iter` and others
example above:
```rust
.each_iter(...).for_each(|link| worker.work(link))
```
#### What do you think about this?
##### In particular @Konard
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the two proposed approaches: a Termination-like HandlerResult trait or removing handlers from the external API through $OP_iter, including the each_iter example. Read linked issue #3 to understand the related direction; done would require a decided approach and a concrete definition of the resulting handler API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100