napi-rs / napi-rs/escape-simd

On the "safety" of escape_into.

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

Nobody has claimed this yet.

Dominant language
Rust
Stars
21
Forks
6
Avg merge
5h 26m
Merged PRs (30d)
6

Description

I am talking about

pub fn escape_into(value: &str, dst: &mut Vec<u8>) {

This thing is pure unsafe semantically, a clear UB. IMO it should be deprecated and an alternative should be recommended:

pub unsafe fn escape_append(value: &str, dst: *mut u8, len: usize) -> usize { // or *mut u8

This would be

  • Fair. One should not promise what he's not going to deliver.
  • Performant and actually more handy.

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

The issue names only the escape_into entry point and no files or tests. Start by locating its implementation and reviewing the current API contract, then compare the proposed escape_append signatures; done requires a settled API and safety design before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.