The error is not about your decoded function. It's about the map callback function.
You need to change string.map(|s| s.as_str()) to string.as_ref().map(|s| s.as_str()), which can be abbreviated as string.as_deref().
That's because map() on Option<String> is expected to destroy the String in the process (it maps one type to another, and after map the old type ceases to exist).
By adding as_ref() you make it Option<&String> and destroying of &String doesn't do anything, so the string data keeps existing.
That's because map() on Option<String> is expected to destroy the String in the process (it maps one type to another, and after map the old type ceases to exist).