From 9d91609b70f6018c1d0871e33aa62afffdfbd7ff Mon Sep 17 00:00:00 2001 From: kageru Date: Tue, 9 Jun 2020 20:46:49 +0200 Subject: [PATCH] Make URL optional for AUR queries --- src/commands/aur.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/aur.rs b/src/commands/aur.rs index ff0a047..b3bac1b 100644 --- a/src/commands/aur.rs +++ b/src/commands/aur.rs @@ -42,7 +42,7 @@ struct Package { #[serde(rename = "Description")] description: String, #[serde(rename = "URL")] - url: String, + url: Option, #[serde(rename = "NumVotes")] votes: u16, #[serde(rename = "Popularity")] @@ -54,7 +54,11 @@ impl fmt::Display for Package { write!( f, "aur/{} {} (+{})\n {}\n url: {}", - self.name, self.version, self.votes, self.description, self.url + self.name, + self.version, + self.votes, + self.description, + self.url.clone().unwrap_or(String::from("none")) ) } }