Skip to content

Derive AsRefStr

Peter Glotfelty edited this page Aug 18, 2019 · 1 revision

Implements AsRef<str> on your enum using the same rules as Display for determining what string is returned. The difference is that as_ref() returns a &str instead of a String so you don't allocate any additional memory with each call.