This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-rust.git
commit 29f0eab0073b5d8668a702df932b36040d23f8f9 Author: yang <[email protected]> AuthorDate: Mon Jun 27 21:27:40 2022 +0800 refactor(dubbo): update by cargo check --- dubbo/src/lib.rs | 4 +--- dubbo/src/service/grpc/grpc_exporter.rs | 2 +- dubbo/src/service/grpc/grpc_invoker.rs | 12 ++++++------ dubbo/src/service/grpc/grpc_server.rs | 6 +++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dubbo/src/lib.rs b/dubbo/src/lib.rs index 7a10cf1..317ed6f 100644 --- a/dubbo/src/lib.rs +++ b/dubbo/src/lib.rs @@ -1,6 +1,4 @@ pub mod helloworld; pub mod service; pub mod common; -pub mod utils; - -pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>; \ No newline at end of file +pub mod utils; \ No newline at end of file diff --git a/dubbo/src/service/grpc/grpc_exporter.rs b/dubbo/src/service/grpc/grpc_exporter.rs index 2940429..4f367f2 100644 --- a/dubbo/src/service/grpc/grpc_exporter.rs +++ b/dubbo/src/service/grpc/grpc_exporter.rs @@ -7,7 +7,7 @@ pub struct GrpcExporter<T> { } impl<T> GrpcExporter<T> { - pub fn new(key: String, invoker: T) -> GrpcExporter<T> { + pub fn new(_key: String, invoker: T) -> GrpcExporter<T> { Self { invoker } } } diff --git a/dubbo/src/service/grpc/grpc_invoker.rs b/dubbo/src/service/grpc/grpc_invoker.rs index fd48e73..6016914 100644 --- a/dubbo/src/service/grpc/grpc_invoker.rs +++ b/dubbo/src/service/grpc/grpc_invoker.rs @@ -53,18 +53,18 @@ impl Invoker for GrpcInvoker { let (metadata, _) = req.into_parts(); let resp = invocation::Response::new("string"); - let (resp_meta, msg) = resp.into_parts(); + let (_resp_meta, msg) = resp.into_parts(); invocation::Response::from_parts(metadata, msg.to_string()) } } -impl<T> invocation::Request<T> { +// impl<T> invocation::Request<T> { - pub(crate) fn to_tonic_req(self) -> tonic::Request<T> { - tonic::Request::new(self.message) - } -} +// pub(crate) fn to_tonic_req(self) -> tonic::Request<T> { +// tonic::Request::new(self.message) +// } +// } impl Clone for GrpcInvoker { fn clone(&self) -> Self { diff --git a/dubbo/src/service/grpc/grpc_server.rs b/dubbo/src/service/grpc/grpc_server.rs index 3a9c6a8..1047054 100644 --- a/dubbo/src/service/grpc/grpc_server.rs +++ b/dubbo/src/service/grpc/grpc_server.rs @@ -32,12 +32,12 @@ pub trait DubboGrpcService<T> pub struct ServiceDesc { service_name: String, - methods: HashMap<String, String> // "/Greeter/hello": "unary" + // methods: HashMap<String, String> // "/Greeter/hello": "unary" } impl ServiceDesc { - pub fn new(service_name: String, methods: HashMap<String, String>) -> Self { - Self { service_name, methods } + pub fn new(service_name: String, _methods: HashMap<String, String>) -> Self { + Self { service_name } } pub fn get_service_name(&self) -> String {
