@@ -2107,31 +2107,31 @@ impl PartialEq for PathBuf {
21072107impl cmp:: PartialEq < str > for PathBuf {
21082108 #[ inline]
21092109 fn eq ( & self , other : & str ) -> bool {
2110- Path :: eq ( self , other)
2110+ self . as_path ( ) == other
21112111 }
21122112}
21132113
21142114#[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
21152115impl cmp:: PartialEq < PathBuf > for str {
21162116 #[ inline]
21172117 fn eq ( & self , other : & PathBuf ) -> bool {
2118- other == self
2118+ self == other . as_path ( )
21192119 }
21202120}
21212121
21222122#[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
21232123impl cmp:: PartialEq < String > for PathBuf {
21242124 #[ inline]
21252125 fn eq ( & self , other : & String ) -> bool {
2126- * * self == * * other
2126+ self . as_path ( ) == other. as_str ( )
21272127 }
21282128}
21292129
21302130#[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
21312131impl cmp:: PartialEq < PathBuf > for String {
21322132 #[ inline]
21332133 fn eq ( & self , other : & PathBuf ) -> bool {
2134- other == self
2134+ self . as_str ( ) == other . as_path ( )
21352135 }
21362136}
21372137
@@ -3426,15 +3426,15 @@ impl cmp::PartialEq<Path> for str {
34263426impl cmp:: PartialEq < String > for Path {
34273427 #[ inline]
34283428 fn eq ( & self , other : & String ) -> bool {
3429- self == & * other
3429+ self == other. as_str ( )
34303430 }
34313431}
34323432
34333433#[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
34343434impl cmp:: PartialEq < Path > for String {
34353435 #[ inline]
34363436 fn eq ( & self , other : & Path ) -> bool {
3437- other == self
3437+ self . as_str ( ) == other
34383438 }
34393439}
34403440
0 commit comments