我试图使这种转换(Option<Option<String>>
到Option<Option<&str>>
)成为可能,但我仍然失败后,try 了许多方法,包括使用.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.