linksplatform / linksplatform/doublets-rs

Use associated types in Doublets trait

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue:Incomplete
Dominant language
Rust
Stars
6
Forks
0
Avg merge
1h 37m
Merged PRs (30d)
1

Description

### Use `Doublets` instead of `Doublets`
This is idiomatically more correct. For example – `AsRef` and `Deref`:
```rust
let string = "hello".to_string();
// we want `AsRef<[u8]>`
let bytes: &[u8] = string.as_ref();
// we want `AsRef`
let str: &str = string.as_ref();
```
```rust
let string = "hello".to_string();
let str = &*string; // we are given `str`
```

This will also make generic storing doublets than easier.
```rust
struct Wrapper> {
doublets: D,
_marker: PhantomData,
}
```
```rust
struct Wrapper {
doublets: D,
}
// `T` is `D::Item`
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Doublets trait and every Doublets implementation or use. Read the trait bounds and existing tests first, then update the API to use the associated Item type and verify that the project compiles and its tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.