use std::{collections::HashSet, str::FromStr}; use url::Url; pub struct Trackers(HashSet); impl Trackers { pub fn init(trackers: &Vec) -> anyhow::Result { let mut t = HashSet::with_capacity(trackers.len()); for tracker in trackers { t.insert(Url::from_str(tracker)?); } Ok(Self(t)) } pub fn is_empty(&self) -> bool { self.0.is_empty() } pub fn list(&self) -> &HashSet { &self.0 } }