diff --git a/services/backup/blob_client/src/get_client.rs b/services/backup/blob_client/src/get_client.rs --- a/services/backup/blob_client/src/get_client.rs +++ b/services/backup/blob_client/src/get_client.rs @@ -16,7 +16,7 @@ struct ReadClient { rx: mpsc::Receiver>, - rx_handle: JoinHandle>, + rx_handle: JoinHandle>, } lazy_static! { @@ -28,7 +28,7 @@ Mutex::new(Vec::new()); } -fn is_initialized(holder: &str) -> anyhow::Result { +fn is_initialized(holder: &str) -> anyhow::Result { if let Ok(clients) = CLIENTS.lock() { return Ok(clients.contains_key(holder)); } @@ -37,7 +37,7 @@ pub fn get_client_initialize_cxx( holder: &str, -) -> anyhow::Result<(), anyhow::Error> { +) -> anyhow::Result<()> { if is_initialized(&holder)? { get_client_terminate_cxx(holder.clone())?; } @@ -91,7 +91,7 @@ pub fn get_client_blocking_read_cxx( holder: &str, -) -> anyhow::Result, anyhow::Error> { +) -> anyhow::Result> { Ok(RUNTIME.block_on(async { if let Ok(mut clients) = CLIENTS.lock() { if let Some(client) = clients.get_mut(&holder.to_string()) { @@ -108,7 +108,7 @@ pub fn get_client_terminate_cxx( holder: &str, -) -> anyhow::Result<(), anyhow::Error> { +) -> anyhow::Result<()> { if !is_initialized(&holder)? { return Ok(()); } diff --git a/services/backup/blob_client/src/put_client.rs b/services/backup/blob_client/src/put_client.rs --- a/services/backup/blob_client/src/put_client.rs +++ b/services/backup/blob_client/src/put_client.rs @@ -29,7 +29,7 @@ tx: mpsc::Sender, rx: mpsc::Receiver, - rx_handle: JoinHandle>, + rx_handle: JoinHandle>, } lazy_static! { @@ -41,7 +41,7 @@ Mutex::new(Vec::new()); } -fn is_initialized(holder: &str) -> anyhow::Result { +fn is_initialized(holder: &str) -> anyhow::Result { match CLIENTS.lock() { Ok(clients) => Ok(clients.contains_key(holder)), _ => bail!("couldn't access client") @@ -50,7 +50,7 @@ pub fn put_client_initialize_cxx( holder: &str, -) -> anyhow::Result<(), anyhow::Error> { +) -> anyhow::Result<()> { if is_initialized(&holder)? { put_client_terminate_cxx(&holder.to_string())?; } @@ -167,7 +167,7 @@ pub fn put_client_blocking_read_cxx( holder: &str, -) -> anyhow::Result { +) -> anyhow::Result { Ok(RUNTIME.block_on(async { if let Ok(mut clients) = CLIENTS.lock() { let maybe_client = clients.get_mut(holder); @@ -199,7 +199,7 @@ holder: &str, field_index: usize, data: *const c_char, -) -> anyhow::Result<(), anyhow::Error> { +) -> anyhow::Result<()> { let data_c_str: &CStr = unsafe { CStr::from_ptr(data) }; let data_bytes: Vec = data_c_str.to_bytes().to_vec(); @@ -226,7 +226,7 @@ pub fn put_client_terminate_cxx( holder: &str, -) -> anyhow::Result<(), anyhow::Error> { +) -> anyhow::Result<()> { if !is_initialized(&holder)? { return Ok(()); }