From 4984868e21f139c58d52669dcf07416e77383724 Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Mon, 5 Aug 2019 16:32:14 -0700 Subject: [PATCH] EventResult::into --> EventResult::into_result --- src/key/verification/start.rs | 14 +++++++------- src/lib.rs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/key/verification/start.rs b/src/key/verification/start.rs index 4ca6690f..be40dc86 100644 --- a/src/key/verification/start.rs +++ b/src/key/verification/start.rs @@ -602,7 +602,7 @@ mod tests { r#"{"from_device":"123","transaction_id":"456","method":"m.sas.v1","hashes":["sha256"],"key_agreement_protocols":["curve25519"],"message_authentication_codes":["hkdf-hmac-sha256"],"short_authentication_string":["decimal"]}"# ) .unwrap() - .into() + .into_result() .unwrap(), key_verification_start_content ); @@ -616,7 +616,7 @@ mod tests { r#"{"content":{"from_device":"123","transaction_id":"456","method":"m.sas.v1","key_agreement_protocols":["curve25519"],"hashes":["sha256"],"message_authentication_codes":["hkdf-hmac-sha256"],"short_authentication_string":["decimal"]},"type":"m.key.verification.start"}"# ) .unwrap() - .into() + .into_result() .unwrap(), key_verification_start ) @@ -634,7 +634,7 @@ mod tests { let error = serde_json::from_str::>(r#"{"from_device":"123"}"#) .unwrap() - .into() + .into_result() .unwrap_err(); assert!(error.message().contains("missing field")); @@ -648,7 +648,7 @@ mod tests { r#"{"from_device":"123","transaction_id":"456","method":"m.sas.v1","key_agreement_protocols":[],"hashes":["sha256"],"message_authentication_codes":["hkdf-hmac-sha256"],"short_authentication_string":["decimal"]}"# ) .unwrap() - .into() + .into_result() .unwrap_err(); assert!(error.message().contains("key_agreement_protocols")); @@ -662,7 +662,7 @@ mod tests { r#"{"from_device":"123","transaction_id":"456","method":"m.sas.v1","key_agreement_protocols":["curve25519"],"hashes":[],"message_authentication_codes":["hkdf-hmac-sha256"],"short_authentication_string":["decimal"]}"# ) .unwrap() - .into() + .into_result() .unwrap_err(); assert!(error.message().contains("hashes")); @@ -676,7 +676,7 @@ mod tests { r#"{"from_device":"123","transaction_id":"456","method":"m.sas.v1","key_agreement_protocols":["curve25519"],"hashes":["sha256"],"message_authentication_codes":[],"short_authentication_string":["decimal"]}"# ) .unwrap() - .into() + .into_result() .unwrap_err(); assert!(error.message().contains("message_authentication_codes")); @@ -690,7 +690,7 @@ mod tests { r#"{"from_device":"123","transaction_id":"456","method":"m.sas.v1","key_agreement_protocols":["curve25519"],"hashes":["sha256"],"message_authentication_codes":["hkdf-hmac-sha256"],"short_authentication_string":[]}"# ) .unwrap() - .into() + .into_result() .unwrap_err(); assert!(error.message().contains("short_authentication_string")); diff --git a/src/lib.rs b/src/lib.rs index 56fecfb4..c9539ae4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -255,7 +255,7 @@ pub enum EventResult { impl EventResult { /// Convert `EventResult` into the equivalent `std::result::Result`. - pub fn into(self) -> Result { + pub fn into_result(self) -> Result { match self { EventResult::Ok(t) => Ok(t), EventResult::Err(invalid_event) => Err(invalid_event),