This is an automated email from the ASF dual-hosted git repository. mssun pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git
commit 4c58f50ef2aab658c96729873e67284226eb34a7 Author: Mingshen Sun <[email protected]> AuthorDate: Sun Feb 2 16:07:44 2020 -0800 [proto] Replace generic to simpler sytax: impl Trait --- services/proto/src/teaclave_authentication_service.rs | 17 +++-------------- services/proto/src/teaclave_common.rs | 6 +----- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/services/proto/src/teaclave_authentication_service.rs b/services/proto/src/teaclave_authentication_service.rs index e2ae30b..2099aa9 100644 --- a/services/proto/src/teaclave_authentication_service.rs +++ b/services/proto/src/teaclave_authentication_service.rs @@ -21,11 +21,7 @@ pub struct UserRegisterRequest { } impl UserRegisterRequest { - pub fn new<S, T>(id: S, password: T) -> Self - where - S: Into<String>, - T: Into<String>, - { + pub fn new(id: impl Into<String>, password: impl Into<String>) -> Self { Self { id: id.into(), password: password.into(), @@ -43,11 +39,7 @@ pub struct UserLoginRequest { } impl UserLoginRequest { - pub fn new<S, T>(id: S, password: T) -> Self - where - S: Into<String>, - T: Into<String>, - { + pub fn new(id: impl Into<String>, password: impl Into<String>) -> Self { Self { id: id.into(), password: password.into(), @@ -61,10 +53,7 @@ pub struct UserLoginResponse { } impl UserLoginResponse { - pub fn new<S>(token: S) -> Self - where - S: Into<String>, - { + pub fn new(token: impl Into<String>) -> Self { Self { token: token.into(), } diff --git a/services/proto/src/teaclave_common.rs b/services/proto/src/teaclave_common.rs index 8cdbe4c..b14ca30 100644 --- a/services/proto/src/teaclave_common.rs +++ b/services/proto/src/teaclave_common.rs @@ -16,11 +16,7 @@ pub struct UserCredential { } impl UserCredential { - pub fn new<S, T>(id: S, token: T) -> Self - where - S: Into<String>, - T: Into<String>, - { + pub fn new(id: impl Into<String>, token: impl Into<String>) -> Self { Self { id: id.into(), token: token.into(), --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
