I find that I need to convert Option<String> to Option<&str> quite often. Simple option.as_ref() is not sufficient, because it gives Option<&String> which doesn’t automagically deref.
The code for this is not terrible, but relatively long for an operation that seems basic: option.as_ref().map(|s| s.as_str()).
Could there be a better method for this? What would it be?
OK, there’s Option::deref()