lightweight com.atproto.sync.listReposByCollection
45
fork

Configure Feed

Select the types of activity you want to include in your feed.

just the nsid

phil bec3f003 093b7c35

+6 -6
+6 -6
src/mst/slice_tricks.rs
··· 26 26 /// there is probably a nice way to implement PartialOrd, but... we're just 27 27 /// going to tack a `/` on the end and call it a day 28 28 #[derive(Debug, PartialEq, Eq)] 29 - pub struct SortableCollection(String); 29 + pub struct SortableCollection(Nsid<'static>); 30 30 31 31 impl Ord for SortableCollection { 32 32 fn cmp(&self, other: &Self) -> Ordering { 33 - let (s, o) = (&self.0, &other.0); 33 + let (s, o) = (&self.0.as_str(), &other.0.as_str()); 34 34 35 35 if s.len() < o.len() 36 36 && let Some(o_suffix) = o.strip_prefix(s) ··· 54 54 } 55 55 } 56 56 57 - impl<'a> From<&Nsid<'a>> for SortableCollection { 58 - fn from(nsid: &Nsid<'a>) -> SortableCollection { 57 + impl<'a> From<&'a Nsid<'a>> for SortableCollection { 58 + fn from(nsid: &'a Nsid<'a>) -> SortableCollection { 59 59 let s = nsid.to_string(); 60 - SortableCollection(s) 60 + SortableCollection(s.into()) 61 61 } 62 62 } 63 63 ··· 66 66 /// 67 67 /// panics if missing the '/' suffix or if the nsid got messed up 68 68 fn from(SortableCollection(s): &SortableCollection) -> Nsid<'static> { 69 - Nsid::from(s.clone()) 69 + s.clone() 70 70 } 71 71 } 72 72