|
@@ -138,7 +138,7 @@ pub struct Issue {
|
|
|
|
|
|
#[derive(Debug, serde::Deserialize)]
|
|
#[derive(Debug, serde::Deserialize)]
|
|
pub struct Comment {
|
|
pub struct Comment {
|
|
- #[serde(default)]
|
|
|
|
|
|
+ #[serde(deserialize_with = "opt_string")]
|
|
pub body: String,
|
|
pub body: String,
|
|
pub html_url: String,
|
|
pub html_url: String,
|
|
pub user: User,
|
|
pub user: User,
|
|
@@ -146,6 +146,17 @@ pub struct Comment {
|
|
pub updated_at: chrono::DateTime<Utc>,
|
|
pub updated_at: chrono::DateTime<Utc>,
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+fn opt_string<'de, D>(deserializer: D) -> Result<String, D::Error>
|
|
|
|
+where
|
|
|
|
+ D: serde::de::Deserializer<'de>,
|
|
|
|
+{
|
|
|
|
+ use serde::de::Deserialize;
|
|
|
|
+ match <Option<String>>::deserialize(deserializer) {
|
|
|
|
+ Ok(v) => Ok(v.unwrap_or_default()),
|
|
|
|
+ Err(e) => Err(e),
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
#[derive(Debug)]
|
|
#[derive(Debug)]
|
|
pub enum AssignmentError {
|
|
pub enum AssignmentError {
|
|
InvalidAssignee,
|
|
InvalidAssignee,
|