Closed
Description
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
Metadata
Metadata
Assignees
Labels
No labels