From 72889b8f1a480d3cb5164e48531f39fd3f768bbb Mon Sep 17 00:00:00 2001 From: Trent Waddington Date: Tue, 10 Oct 2023 12:51:11 +1000 Subject: [PATCH] Fix warnings. --- .../operations/operation_value_changed.rs | 10 ++++++++++ .../coders/operations/operation_watch_value.rs | 17 +++++++++++++++++ veilid-server/src/windows.rs | 6 ++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/veilid-core/src/rpc_processor/coders/operations/operation_value_changed.rs b/veilid-core/src/rpc_processor/coders/operations/operation_value_changed.rs index b138d884..9ccc2295 100644 --- a/veilid-core/src/rpc_processor/coders/operations/operation_value_changed.rs +++ b/veilid-core/src/rpc_processor/coders/operations/operation_value_changed.rs @@ -10,6 +10,7 @@ pub struct RPCOperationValueChanged { } impl RPCOperationValueChanged { + #[allow(dead_code)] pub fn new( key: TypedKey, subkeys: ValueSubkeyRangeSet, @@ -29,18 +30,27 @@ impl RPCOperationValueChanged { Ok(()) } + #[allow(dead_code)] pub fn key(&self) -> &TypedKey { &self.key } + + #[allow(dead_code)] pub fn subkeys(&self) -> &ValueSubkeyRangeSet { &self.subkeys } + + #[allow(dead_code)] pub fn count(&self) -> u32 { self.count } + + #[allow(dead_code)] pub fn value(&self) -> &SignedValueData { &self.value } + + #[allow(dead_code)] pub fn destructure(self) -> (TypedKey, ValueSubkeyRangeSet, u32, SignedValueData) { (self.key, self.subkeys, self.count, self.value) } diff --git a/veilid-core/src/rpc_processor/coders/operations/operation_watch_value.rs b/veilid-core/src/rpc_processor/coders/operations/operation_watch_value.rs index f7e0ea14..ffd5ae23 100644 --- a/veilid-core/src/rpc_processor/coders/operations/operation_watch_value.rs +++ b/veilid-core/src/rpc_processor/coders/operations/operation_watch_value.rs @@ -14,6 +14,7 @@ pub struct RPCOperationWatchValueQ { } impl RPCOperationWatchValueQ { + #[allow(dead_code)] pub fn new( key: TypedKey, subkeys: ValueSubkeyRangeSet, @@ -70,25 +71,37 @@ impl RPCOperationWatchValueQ { Ok(()) } + #[allow(dead_code)] pub fn key(&self) -> &TypedKey { &self.key } + + #[allow(dead_code)] pub fn subkeys(&self) -> &ValueSubkeyRangeSet { &self.subkeys } + + #[allow(dead_code)] pub fn expiration(&self) -> u64 { self.expiration } + + #[allow(dead_code)] pub fn count(&self) -> u32 { self.count } + + #[allow(dead_code)] pub fn watcher(&self) -> &PublicKey { &self.watcher } + + #[allow(dead_code)] pub fn signature(&self) -> &Signature { &self.signature } + #[allow(dead_code)] pub fn destructure( self, ) -> ( @@ -192,6 +205,7 @@ pub struct RPCOperationWatchValueA { } impl RPCOperationWatchValueA { + #[allow(dead_code)] pub fn new(expiration: u64, peers: Vec) -> Result { if peers.len() > MAX_WATCH_VALUE_A_PEERS_LEN { return Err(RPCError::protocol("WatchValueA peers length too long")); @@ -204,12 +218,15 @@ impl RPCOperationWatchValueA { Ok(()) } + #[allow(dead_code)] pub fn expiration(&self) -> u64 { self.expiration } + #[allow(dead_code)] pub fn peers(&self) -> &[PeerInfo] { &self.peers } + #[allow(dead_code)] pub fn destructure(self) -> (u64, Vec) { (self.expiration, self.peers) } diff --git a/veilid-server/src/windows.rs b/veilid-server/src/windows.rs index 0b9718a1..06d5170c 100644 --- a/veilid-server/src/windows.rs +++ b/veilid-server/src/windows.rs @@ -11,7 +11,7 @@ use windows_service::*; // Register generated `ffi_service_main` with the system and start the service, blocking // this thread until the service is stopped. -pub fn run_service(settings: Settings, _args: CmdlineArgs) -> EyreResult<()> { +pub fn run_service(_settings: Settings, _args: CmdlineArgs) -> EyreResult<()> { eprintln!("Windows Service mode not implemented yet."); //service_dispatcher::start("veilid-server", ffi_veilid_service_main)?; @@ -21,6 +21,7 @@ pub fn run_service(settings: Settings, _args: CmdlineArgs) -> EyreResult<()> { /////////////// define_windows_service!(ffi_veilid_service_main, veilid_service_main); +#[allow(dead_code)] fn veilid_service_main(arguments: Vec) { if let Err(e) = register_service_handler(arguments) { error!("{}", e); @@ -29,7 +30,8 @@ fn veilid_service_main(arguments: Vec) { /////////////// -fn register_service_handler(arguments: Vec) -> windows_service::Result<()> { +#[allow(dead_code)] +fn register_service_handler(_arguments: Vec) -> windows_service::Result<()> { let event_handler = move |control_event| -> ServiceControlHandlerResult { match control_event { ServiceControl::Stop => {