From 00ee6030c0f26d16f84c4342a1f05f8244e8d892 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 28 Sep 2023 11:35:47 +0200 Subject: [PATCH] identifiers: Remove unnecessary as_str calls from room_id tests --- crates/ruma-common/src/identifiers/room_id.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/crates/ruma-common/src/identifiers/room_id.rs b/crates/ruma-common/src/identifiers/room_id.rs index 163f9c68..0ffd87b9 100644 --- a/crates/ruma-common/src/identifiers/room_id.rs +++ b/crates/ruma-common/src/identifiers/room_id.rs @@ -216,9 +216,7 @@ mod tests { #[test] fn valid_room_id() { assert_eq!( - <&RoomId>::try_from("!29fhd83h92h0:example.com") - .expect("Failed to create RoomId.") - .as_str(), + <&RoomId>::try_from("!29fhd83h92h0:example.com").expect("Failed to create RoomId."), "!29fhd83h92h0:example.com" ); } @@ -226,7 +224,7 @@ mod tests { #[test] fn empty_localpart() { assert_eq!( - <&RoomId>::try_from("!:example.com").expect("Failed to create RoomId.").as_str(), + <&RoomId>::try_from("!:example.com").expect("Failed to create RoomId."), "!:example.com" ); } @@ -266,9 +264,7 @@ mod tests { #[test] fn valid_room_id_with_explicit_standard_port() { assert_eq!( - <&RoomId>::try_from("!29fhd83h92h0:example.com:443") - .expect("Failed to create RoomId.") - .as_str(), + <&RoomId>::try_from("!29fhd83h92h0:example.com:443").expect("Failed to create RoomId."), "!29fhd83h92h0:example.com:443" ); } @@ -277,8 +273,7 @@ mod tests { fn valid_room_id_with_non_standard_port() { assert_eq!( <&RoomId>::try_from("!29fhd83h92h0:example.com:5000") - .expect("Failed to create RoomId.") - .as_str(), + .expect("Failed to create RoomId."), "!29fhd83h92h0:example.com:5000" ); }