Skip to content

On the "safety" of escape_into. #73

Description

@sirkon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions