Skip to content

rename Bytes::as_string() to to_string(), as_vector() to to_vector() #334

@milyin

Description

@milyin

Describe the release item

The as_ prefix supposes that the returned value still references to the original owner. E.g. KeyExpr::as_string_view is completely correct as the string view is just a refernence to value which contained in KeyExpt. On the other hand the to_ prefix supposes transferring the ownership. E.g. Config::to_string() creates new std::string object.

So normally the as_string and as_vector should be to_string and to_vector.

The proposal is:

  • add methods to_string and to_vector to Bytes
  • keep as_string and as_vector as the API is already stabilized, but mark them as deprecated and remove them from the documentation
  • do all necessary renaming in the examples/tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    releasePart of the next release

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions