Remove unnecessary explicit lifetimes

This commit is contained in:
Jonas Platte 2019-12-15 20:23:57 +01:00
parent 2754e14003
commit 98f85df276
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
3 changed files with 8 additions and 8 deletions

View File

@ -38,8 +38,8 @@ impl Display for EventType {
} }
} }
impl<'a> From<&'a str> for EventType { impl<'a> From<&str> for EventType {
fn from(s: &'a str) -> EventType { fn from(s: &str) -> EventType {
match s { match s {
"m.direct" => EventType::Direct, "m.direct" => EventType::Direct,
"m.room.aliases" => EventType::RoomAliases, "m.room.aliases" => EventType::RoomAliases,

View File

@ -101,8 +101,8 @@ impl Display for CancelCode {
} }
} }
impl<'a> From<&'a str> for CancelCode { impl<'a> From<&str> for CancelCode {
fn from(s: &'a str) -> CancelCode { fn from(s: &str) -> CancelCode {
match s { match s {
"m.user" => CancelCode::User, "m.user" => CancelCode::User,
"m.timeout" => CancelCode::Timeout, "m.timeout" => CancelCode::Timeout,

View File

@ -666,8 +666,8 @@ impl Display for EventType {
} }
} }
impl<'a> From<&'a str> for EventType { impl<'a> From<&str> for EventType {
fn from(s: &'a str) -> EventType { fn from(s: &str) -> EventType {
match s { match s {
"m.call.answer" => EventType::CallAnswer, "m.call.answer" => EventType::CallAnswer,
"m.call.candidates" => EventType::CallCandidates, "m.call.candidates" => EventType::CallCandidates,
@ -785,8 +785,8 @@ impl Display for Algorithm {
} }
} }
impl<'a> From<&'a str> for Algorithm { impl<'a> From<&str> for Algorithm {
fn from(s: &'a str) -> Algorithm { fn from(s: &str) -> Algorithm {
match s { match s {
"m.olm.v1.curve25519-aes-sha2" => Algorithm::OlmV1Curve25519AesSha2, "m.olm.v1.curve25519-aes-sha2" => Algorithm::OlmV1Curve25519AesSha2,
"m.megolm.v1.aes-sha2" => Algorithm::MegolmV1AesSha2, "m.megolm.v1.aes-sha2" => Algorithm::MegolmV1AesSha2,