Closed
Description
There are often situations where you need similar-but-distinct names for functions that allow you to
- convert
&self
to&T
for someT != Self
- convert
self
toT
for someT != Self
- copy
&self
toT
for someT != Self
Those functions at the moment are named in a very ad-hoc fashion: to_bytes()
, slice_str()
, as_char()
, to_bytes_consume()
etc. A standard naming convention would allow to see at a glance what the function does.
One possible set of names could be:
to_TYPE()
for a copy/new allocation.as_TYPE()
for a reference/slice.into_TYPE()
for consuming self and returning the target type without copy.
Metadata
Metadata
Assignees
Labels
No labels