serde-rs / serde-rs/bytes

Removing From<Vec<u8>> and From<ByteBuf> was mistake

Open
#15 1 comment 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
384
Forks
40
PR merge metrics
No merged PRs in 30d

Description

https://github.com/serde-rs/bytes/commit/f8c4812d1e81f4bb7813fa25c37b52dc3e065741
https://github.com/serde-rs/bytes/commit/f810459d2af103184767050e6181846ed9e12138
https://github.com/serde-rs/bytes/issues/3

They could coexists with ByteBuf::from and ByteBuf::into_vec if you think these functions are clearer in documentation. I never had problems with looking for From trait implementations.

Now is not possible to use it with generic functions which uses things like T: From<Vec<u8>>. There is reason why there are traits like From trait in rust.

And solution to problems like this https://github.com/serde-rs/bytes/issues/14 require even more extra glue code as before.

Contributor guide

No contributing guide indexed for this repository

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

Start by reviewing the two linked commits and the discussion in issues 3 and 14, then inspect the public ByteBuf conversion API and its From implementations. Check how generic T: From<Vec> and ByteBuf conversions are tested. Done means the requested conversions are available without breaking the existing ByteBuf::from and ByteBuf::into_vec behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
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.