1use compact_str::CompactString;
2use serde::Deserialize;
3use std::hash::Hash;
4use std::{borrow::Borrow, collections::HashSet, hash::Hasher};
5use url::Url;
6
7#[derive(Eq, Deserialize, Debug)]
8pub struct Artifact {
9 pub name: CompactString,
10 pub url: Url,
11 pub browser_download_url: String,
12}
13
14impl PartialEq for Artifact {
19 fn eq(&self, other: &Self) -> bool {
20 self.name.eq(&other.name)
21 }
22}
23
24impl Hash for Artifact {
25 fn hash<H>(&self, state: &mut H)
26 where
27 H: Hasher,
28 {
29 let s: &str = self.name.as_str();
30 s.hash(state)
31 }
32}
33
34impl Borrow<str> for Artifact {
38 fn borrow(&self) -> &str {
39 &self.name
40 }
41}
42
43#[derive(Debug, Default, Deserialize)]
44pub struct Artifacts {
45 pub assets: HashSet<Artifact>,
46}