twitter-v2-rs
twitter-v2-rs copied to clipboard
Allow empty string for profile image URL
This is a bit of a weird issue and I'm not entirely sure this is the best way to solve it. Essentially, some users have a profile_image_url
that's an empty string, not null, and that obviously can't be deserialized to a url::Url
. This adds a custom function for deserializing that converts empty strings to None
, and continues to parse non-empty strings to a url::Url
. I've loaded tens of thousands of profiles with these changes and it seems to fix the issue.