OSDN Git Service

rusty-gd: remove one level of indirection for hci facade proto
authorZach Johnson <zachoverflow@google.com>
Thu, 5 Nov 2020 01:22:31 +0000 (17:22 -0800)
committerZach Johnson <zachoverflow@google.com>
Fri, 6 Nov 2020 21:10:24 +0000 (13:10 -0800)
Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost
Change-Id: I11fe6201aa4ee76c1389b7d8a23360fa484512c7

gd/rust/hci/src/facade.rs
gd/rust/hci/src/facade/facade_grpc.rs [moved from gd/rust/hci/src/facade/protos/hci_layer_facade_grpc.rs with 100% similarity]
gd/rust/hci/src/facade/protos.rs [deleted file]

index 127743d..c8b1f7c 100644 (file)
@@ -1,6 +1,10 @@
 //! HCI layer facade
 
-pub mod protos;
+mod facade_grpc;
+
+use hci_layer_facade_proto::facade;
+use facade_grpc::{HciLayerFacade, create_hci_layer_facade};
+use facade::*;
 
 use futures::sink::SinkExt;
 use tokio::runtime::Runtime;
@@ -21,9 +25,12 @@ pub struct HciLayerFacadeService {
     pub rt: Arc<Runtime>,
 }
 
-use protos::empty::Empty;
-use protos::facade::*;
-use protos::hci_layer_facade_grpc::{HciLayerFacade, create_hci_layer_facade};
+/// Refer to the following on why we are doing this and for possible solutions:
+/// https://github.com/tikv/grpc-rs/issues/276
+pub mod empty {
+    pub use protobuf::well_known_types::Empty;
+}
+use empty::Empty;
 
 impl HciLayerFacadeService {
     /// Create a new instance of HCI layer facade service
diff --git a/gd/rust/hci/src/facade/protos.rs b/gd/rust/hci/src/facade/protos.rs
deleted file mode 100644 (file)
index 6e47c23..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-//! Rust protobuf code for HCI layer facade service
-
-/// Empty is needed by HciLayerFacadeService
-/// Refer to the following on why we are doing this and for possible solutions:
-/// https://github.com/tikv/grpc-rs/issues/276
-pub mod empty {
-    pub use protobuf::well_known_types::Empty;
-}
-
-pub use hci_layer_facade_proto::facade;
-pub mod hci_layer_facade_grpc;