Use Result::map() instead of matching Err to itself