egg-mode-rs/egg-mode

cannot parse tweet

Closed this issue · 0 comments

UrlEntity::expanded_url is a nullable string.

diff --git a/src/entities.rs b/src/entities.rs
index 9245853..02c4cc7 100644
--- a/src/entities.rs
+++ b/src/entities.rs
@@ -192,7 +192,7 @@ pub struct UrlEntity {
     ///
     ///Meant to be used as hover-text when a user mouses over a link.
     #[serde(default)]
-    pub expanded_url: String,
+    pub expanded_url: Option<String>,
     ///The byte offsets in the companion text where the URL was extracted from.
     #[serde(rename = "indices")]
     pub range: (usize, usize),
diff --git a/src/tweet/mod.rs b/src/tweet/mod.rs
index 778eff4..5cadabc 100644