]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/backup/manifest.rs: rename into_string -> to_string
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 9 Jul 2020 09:28:05 +0000 (11:28 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 9 Jul 2020 09:28:05 +0000 (11:28 +0200)
And do not consume self.

src/backup/manifest.rs
src/bin/proxmox-backup-client.rs

index 83e39e9c56b34fd9599f2318c78f25fcb65a457e..b60582aa7be1fd5344095956b324c37463b20dfb 100644 (file)
@@ -186,7 +186,7 @@ impl BackupManifest {
     }
 
     /// Converts the Manifest into json string, and add a signature if there is a crypt_config.
-    pub fn into_string(self, crypt_config: Option<&CryptConfig>) -> Result<String, Error> {
+    pub fn to_string(&self, crypt_config: Option<&CryptConfig>) -> Result<String, Error> {
 
         let mut manifest = serde_json::to_value(&self)?;
 
@@ -262,7 +262,7 @@ fn test_manifest_signature() -> Result<(), Error> {
 
     manifest.unprotected["note"] = "This is not protected by the signature.".into();
 
-    let text = manifest.into_string(Some(&crypt_config))?;
+    let text = manifest.to_string(Some(&crypt_config))?;
 
     let manifest: Value = serde_json::from_str(&text)?;
     let signature = manifest["signature"].as_str().unwrap().to_string();
index 7c6a05cb38f5265ec87507807908294a210cb1ee..0d1746dd2d881df73b7843b40d1102db0795de4c 100644 (file)
@@ -1082,7 +1082,7 @@ async fn create_backup(
 
     // create manifest (index.json)
     // manifests are never encrypted, but include a signature
-    let manifest = manifest.into_string(crypt_config.as_ref().map(Arc::as_ref))
+    let manifest = manifest.to_string(crypt_config.as_ref().map(Arc::as_ref))
         .map_err(|err| format_err!("unable to format manifest - {}", err))?;