I am trying to make this conversion (Option<Option<String>>
to Option<Option<&str>>
) possible, but I still failed after trying many methods including using .map
.
I know that the conversion is possible, however, if there's no nested Option
(i.e. Option<String>
to Option<&str>
): just using .as_deref()
.
Using .map(|inner| inner.as_deref())
violates the ownership.