Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3247549
D5299.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D5299.diff
View Options
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<Vec<u8>>,
- rx_handle: JoinHandle<anyhow::Result<(), anyhow::Error>>,
+ rx_handle: JoinHandle<anyhow::Result<()>>,
}
lazy_static! {
@@ -28,7 +28,7 @@
Mutex::new(Vec::new());
}
-fn is_initialized(holder: &str) -> anyhow::Result<bool, anyhow::Error> {
+fn is_initialized(holder: &str) -> anyhow::Result<bool> {
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<Vec<u8>, anyhow::Error> {
+) -> anyhow::Result<Vec<u8>> {
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<PutRequestData>,
rx: mpsc::Receiver<String>,
- rx_handle: JoinHandle<anyhow::Result<(), anyhow::Error>>,
+ rx_handle: JoinHandle<anyhow::Result<()>>,
}
lazy_static! {
@@ -41,7 +41,7 @@
Mutex::new(Vec::new());
}
-fn is_initialized(holder: &str) -> anyhow::Result<bool, anyhow::Error> {
+fn is_initialized(holder: &str) -> anyhow::Result<bool> {
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<String, anyhow::Error> {
+) -> anyhow::Result<String> {
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<u8> = 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(());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 5:56 AM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2496578
Default Alt Text
D5299.diff (3 KB)
Attached To
Mode
D5299: [services] Backup - use `anyhow::Result` short form
Attached
Detach File
Event Timeline
Log In to Comment