web_url/url/
compare.rs

1use std::cmp::Ordering;
2use std::hash::{Hash, Hasher};
3
4use crate::WebUrl;
5
6impl Ord for WebUrl {
7    fn cmp(&self, other: &Self) -> Ordering {
8        self.url.cmp(&other.url)
9    }
10}
11
12impl PartialOrd for WebUrl {
13    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
14        Some(self.cmp(other))
15    }
16}
17
18impl Eq for WebUrl {}
19
20impl PartialEq for WebUrl {
21    fn eq(&self, other: &Self) -> bool {
22        self.url.eq(&other.url)
23    }
24}
25
26impl Hash for WebUrl {
27    fn hash<H: Hasher>(&self, state: &mut H) {
28        self.url.hash(state)
29    }
30}