summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d9b877e..abbb8a5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -358,6 +358,18 @@ where
.or(Ok(None))
}
+fn requested_reviewers_ignore_null<'de, D, DE>(
+ deserializer: D,
+) -> Result<Option<Vec<structs::User>>, DE>
+where
+ D: Deserializer<'de>,
+ DE: serde::de::Error,
+{
+ let list: Option<Vec<Option<structs::User>>> =
+ Option::deserialize(deserializer).map_err(DE::custom)?;
+ Ok(list.map(|list| list.into_iter().filter_map(|x| x).collect::<Vec<_>>()))
+}
+
fn parse_ssh_url(raw_url: &String) -> Result<Url, url::ParseError> {
// in case of a non-standard ssh-port (not 22), the ssh url coming from the forgejo API
// is actually parseable by the url crate, so try to do that first