servo / servo/rust-url

Should there be a percent encoding function to add or remove a set (either slice or vec) of bytes from an AsciiSet?

Open
#618 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
406
PR merge metrics
No merged PRs in 30d

Description

In the documentation for percent-encoding, there is this line:

const FRAGMENT: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b'<').add(b'>').add(b'`');

imo, it seems pretty zany that there isn't a function to add or remove a set of bytes from an AsciiSet.

I understand that it may incur some error handling (or having to return a Result) but it would be very nice to:

const FRAGMENT: &AsciiSet = &CONTROLS.add_n([b' ', b'"', b'<', b'>', b'`']);

I'm still a rust noobie so I don't have a MRE for the implementation, but it would make usage of percent-encoding a little nicer.

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 with the AsciiSet documentation and the existing add chain shown in the issue. Determine how a collection of bytes should be added or removed, including the proposed error-handling behavior, then add tests and documentation that demonstrate the completed API.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.