From 2a0414cd60592a716770dcb2718051a902843176 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 15 Dec 2019 20:39:03 +0100 Subject: [PATCH] Remove unnecessary explicit lifetimes --- src/event_id.rs | 4 ++-- src/room_alias_id.rs | 4 ++-- src/room_id.rs | 4 ++-- src/room_id_or_room_alias_id.rs | 4 ++-- src/room_version_id.rs | 4 ++-- src/user_id.rs | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/event_id.rs b/src/event_id.rs index 1b39685c..e9eb73e6 100644 --- a/src/event_id.rs +++ b/src/event_id.rs @@ -156,7 +156,7 @@ impl<'de> Deserialize<'de> for EventId { } } -impl<'a> TryFrom<&'a str> for EventId { +impl TryFrom<&str> for EventId { type Error = Error; /// Attempts to create a new Matrix event ID from a string representation. @@ -164,7 +164,7 @@ impl<'a> TryFrom<&'a str> for EventId { /// If using the original event format as used by Matrix room versions 1 and 2, the string must /// include the leading $ sigil, the localpart, a literal colon, and a valid homeserver /// hostname. - fn try_from(event_id: &'a str) -> Result { + fn try_from(event_id: &str) -> Result { if event_id.contains(':') { let (localpart, host, port) = parse_id('$', event_id)?; diff --git a/src/room_alias_id.rs b/src/room_alias_id.rs index 418b0878..480b94e1 100644 --- a/src/room_alias_id.rs +++ b/src/room_alias_id.rs @@ -81,14 +81,14 @@ impl<'de> Deserialize<'de> for RoomAliasId { } } -impl<'a> TryFrom<&'a str> for RoomAliasId { +impl TryFrom<&str> for RoomAliasId { type Error = Error; /// Attempts to create a new Matrix room alias ID from a string representation. /// /// The string must include the leading # sigil, the alias, a literal colon, and a valid /// server name. - fn try_from(room_id: &'a str) -> Result { + fn try_from(room_id: &str) -> Result { let (alias, host, port) = parse_id('#', room_id)?; Ok(Self { diff --git a/src/room_id.rs b/src/room_id.rs index 2ffc61bb..606ba6ae 100644 --- a/src/room_id.rs +++ b/src/room_id.rs @@ -96,14 +96,14 @@ impl<'de> Deserialize<'de> for RoomId { } } -impl<'a> TryFrom<&'a str> for RoomId { +impl TryFrom<&str> for RoomId { type Error = Error; /// Attempts to create a new Matrix room ID from a string representation. /// /// The string must include the leading ! sigil, the localpart, a literal colon, and a valid /// server name. - fn try_from(room_id: &'a str) -> Result { + fn try_from(room_id: &str) -> Result { let (localpart, host, port) = parse_id('!', room_id)?; Ok(Self { diff --git a/src/room_id_or_room_alias_id.rs b/src/room_id_or_room_alias_id.rs index cc20b18e..c9a768e4 100644 --- a/src/room_id_or_room_alias_id.rs +++ b/src/room_id_or_room_alias_id.rs @@ -89,7 +89,7 @@ impl<'de> Deserialize<'de> for RoomIdOrAliasId { } } -impl<'a> TryFrom<&'a str> for RoomIdOrAliasId { +impl TryFrom<&str> for RoomIdOrAliasId { type Error = Error; /// Attempts to create a new Matrix room ID or a room alias ID from a string representation. @@ -97,7 +97,7 @@ impl<'a> TryFrom<&'a str> for RoomIdOrAliasId { /// The string must either include the leading ! sigil, the localpart, a literal colon, and a /// valid homeserver host or include the leading # sigil, the alias, a literal colon, and a /// valid homeserver host. - fn try_from(room_id_or_alias_id: &'a str) -> Result { + fn try_from(room_id_or_alias_id: &str) -> Result { validate_id(room_id_or_alias_id)?; let mut chars = room_id_or_alias_id.chars(); diff --git a/src/room_version_id.rs b/src/room_version_id.rs index 6277199b..85772263 100644 --- a/src/room_version_id.rs +++ b/src/room_version_id.rs @@ -155,11 +155,11 @@ impl<'de> Deserialize<'de> for RoomVersionId { } } -impl<'a> TryFrom<&'a str> for RoomVersionId { +impl TryFrom<&str> for RoomVersionId { type Error = Error; /// Attempts to create a new Matrix room version ID from a string representation. - fn try_from(room_version_id: &'a str) -> Result { + fn try_from(room_version_id: &str) -> Result { let version = match room_version_id { "1" => Self(InnerRoomVersionId::Version1), "2" => Self(InnerRoomVersionId::Version2), diff --git a/src/user_id.rs b/src/user_id.rs index f01c03bc..990ccb10 100644 --- a/src/user_id.rs +++ b/src/user_id.rs @@ -114,14 +114,14 @@ impl<'de> Deserialize<'de> for UserId { } } -impl<'a> TryFrom<&'a str> for UserId { +impl TryFrom<&str> for UserId { type Error = Error; /// Attempts to create a new Matrix user ID from a string representation. /// /// The string must include the leading @ sigil, the localpart, a literal colon, and a valid /// server name. - fn try_from(user_id: &'a str) -> Result { + fn try_from(user_id: &str) -> Result { let (localpart, host, port) = parse_id('@', user_id)?; let downcased_localpart = localpart.to_lowercase();