5 #[allow(unnecessary_operation)]
7 fn with_to_string(x : &str) {
8 x != "foo".to_string();
10 "foo".to_string() != x;
17 x != "foo".to_owned();
19 x != String::from("foo");
21 42.to_string() == "42";
23 Foo.to_owned() == Foo;
28 impl PartialEq for Foo {
29 fn eq(&self, other: &Self) -> bool {
30 self.to_owned() == *other
34 impl ToOwned for Foo {
36 fn to_owned(&self) -> Bar {
44 impl PartialEq<Foo> for Bar {
45 fn eq(&self, _: &Foo) -> bool {
50 impl std::borrow::Borrow<Foo> for Bar {
51 fn borrow(&self) -> &Foo {
52 static FOO: Foo = Foo;