Skip to content

Add into_ counterparts for all as_ methods #28

Closed
@matthew-piziak

Description

@matthew-piziak

Background

Conversion method naming conventions

RFC 7087 and The Rust Style Guidelines define the following naming conventions for conversion methods:

Prefix Cost Consumes convertee
as_ Free No
to_ Expensive No
into_ Variable Yes

Proposed Enhancement

Currently yaml-rust provides as_ methods (as_str, as_hash, as_vec, etc.) on the impl Yaml. These methods obey the listed convention and do not consume the Yaml object. Adding into_ methods that consume the Yaml object would allow some callers to reduce their overall memory footprint.

Use Case

Code Review Answer (last paragraph)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions