OSDN Git Service

rusty-gd: clean up imports & pub exports
authorZach Johnson <zachoverflow@google.com>
Thu, 5 Nov 2020 01:31:15 +0000 (17:31 -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: Ibd11c0a8c977f022164a5f2c314cc3c2773b68fa

gd/rust/facade/src/lib.rs
gd/rust/hci/src/facade.rs

index 00d0d2f..05280f8 100644 (file)
@@ -8,8 +8,10 @@ pub mod empty {
     pub use protobuf::well_known_types::Empty;
 }
 
-pub use bt_facade_common_proto::common;
-pub use bt_facade_rootservice_proto::rootservice;
+use bt_facade_common_proto::common;
+use bt_facade_rootservice_proto::rootservice;
+use rootservice::*;
+use rootservice_grpc::{create_root_facade, RootFacade};
 
 use bt_hal::rootcanal_hal::{RootcanalConfig, RootcanalHal};
 use bt_hci::facade::HciLayerFacadeService;
@@ -28,15 +30,10 @@ use futures::executor::block_on;
 /// Bluetooth testing root facade service
 #[derive(Clone)]
 pub struct RootFacadeService {
-    /// Tokio runtime
     rt: Arc<Runtime>,
     manager: FacadeServiceManager,
 }
 
-use bt_facade_rootservice_proto::rootservice::*;
-use rootservice_grpc::create_root_facade;
-use rootservice_grpc::RootFacade;
-
 impl RootFacadeService {
     /// Create a new instance of the root facade service
     pub fn create(
index c8b1f7c..3fe06e4 100644 (file)
@@ -2,6 +2,13 @@
 
 mod facade_grpc;
 
+/// 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;
+
 use hci_layer_facade_proto::facade;
 use facade_grpc::{HciLayerFacade, create_hci_layer_facade};
 use facade::*;
@@ -19,19 +26,10 @@ use std::sync::Arc;
 /// HCI layer facade service
 #[derive(Clone)]
 pub struct HciLayerFacadeService {
-    /// HCI interface
-    pub hci_exports: HciExports,
-    /// Tokio runtime
-    pub rt: Arc<Runtime>,
+    hci_exports: HciExports,
+    rt: Arc<Runtime>,
 }
 
-/// 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
     pub fn create(hci_exports: HciExports, rt: Arc<Runtime>) -> grpcio::Service {