We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d23da6 commit 827dbb7Copy full SHA for 827dbb7
library/std/src/path.rs
@@ -3426,7 +3426,7 @@ impl cmp::PartialEq<Path> for str {
3426
impl cmp::PartialEq<String> for Path {
3427
#[inline]
3428
fn eq(&self, other: &String) -> bool {
3429
- self == &*other
+ self == other.as_str()
3430
}
3431
3432
library/std/tests/path.rs
@@ -2529,6 +2529,12 @@ fn normalize_lexically() {
2529
2530
#[test]
2531
/// See issue#146183
2532
-fn compare_path_to_str() {
+fn compare_pathbuf_to_str() {
2533
assert!(&PathBuf::from("x") == "x");
2534
2535
+
2536
+#[test]
2537
+/// See issue#146940
2538
+fn compare_path_to_string() {
2539
+ assert!(Path::new("x") == &String::from("x"));
2540
+}
0 commit comments