File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ use std::str;
138138use std:: path:: { Path , PathBuf } ;
139139use std:: borrow:: Borrow ;
140140use std:: hash:: { Hash , Hasher } ;
141+ use std:: cmp:: Ordering ;
141142
142143#[ cfg( feature="serde_serialization" ) ]
143144use std:: str:: FromStr ;
@@ -227,7 +228,7 @@ pub enum SchemeData {
227228}
228229
229230/// Components for URLs in a *relative* scheme such as HTTP.
230- #[ derive( Clone , Debug , PartialOrd , Ord ) ]
231+ #[ derive( Clone , Debug ) ]
231232#[ cfg_attr( feature="heap_size" , derive( HeapSizeOf ) ) ]
232233pub struct RelativeSchemeData {
233234 /// The username of the URL, as a possibly empty, percent-encoded string.
@@ -295,6 +296,18 @@ impl Hash for RelativeSchemeData {
295296 }
296297}
297298
299+ impl PartialOrd for RelativeSchemeData {
300+ fn partial_cmp ( & self , other : & RelativeSchemeData ) -> Option < Ordering > {
301+ self . get_identity_key ( ) . partial_cmp ( & other. get_identity_key ( ) )
302+ }
303+ }
304+
305+ impl Ord for RelativeSchemeData {
306+ fn cmp ( & self , other : & Self ) -> Ordering {
307+ self . get_identity_key ( ) . cmp ( & other. get_identity_key ( ) )
308+ }
309+ }
310+
298311impl str:: FromStr for Url {
299312 type Err = ParseError ;
300313
You can’t perform that action at this time.
0 commit comments