src/backup/manifest.rs: rename into_string -> to_string
And do not consume self.
This commit is contained in:
		| @ -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(); | ||||
|  | ||||
| @ -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))?; | ||||
|  | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user