[pbs-devel] [PATCH proxmox-backup 3/4] backup-client: use () instead of Value as return type

Dominik Csapak d.csapak at proxmox.com
Thu Oct 28 11:47:54 CEST 2021


shorter and we do a conversion anyway

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 proxmox-backup-client/src/snapshot.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/proxmox-backup-client/src/snapshot.rs b/proxmox-backup-client/src/snapshot.rs
index 46b1db09..a9976fbe 100644
--- a/proxmox-backup-client/src/snapshot.rs
+++ b/proxmox-backup-client/src/snapshot.rs
@@ -377,7 +377,7 @@ async fn update_notes(param: Value) -> Result<Value, Error> {
     }
 )]
 /// Show protection status of the specified snapshot
-async fn show_protection(param: Value) -> Result<Value, Error> {
+async fn show_protection(param: Value) -> Result<(), Error> {
     let repo = extract_repository_from_value(&param)?;
     let path = required_string_param(&param, "snapshot")?;
 
@@ -411,7 +411,7 @@ async fn show_protection(param: Value) -> Result<Value, Error> {
         );
     }
 
-    Ok(Value::Null)
+    Ok(())
 }
 
 #[api(
@@ -433,7 +433,7 @@ async fn show_protection(param: Value) -> Result<Value, Error> {
     }
 )]
 /// Update Protection Status of a snapshot
-async fn update_protection(protected: bool, param: Value) -> Result<Value, Error> {
+async fn update_protection(protected: bool, param: Value) -> Result<(), Error> {
     let repo = extract_repository_from_value(&param)?;
     let path = required_string_param(&param, "snapshot")?;
 
@@ -451,7 +451,7 @@ async fn update_protection(protected: bool, param: Value) -> Result<Value, Error
 
     client.put(&path, Some(args)).await?;
 
-    Ok(Value::Null)
+    Ok(())
 }
 
 fn protected_cli() -> CliCommandMap {
-- 
2.30.2





More information about the pbs-devel mailing list