Remove unnecessary clone of a String (#28758)

This commit is contained in:
Sergey Melnychuk 2022-11-07 21:42:19 +01:00 committed by GitHub
parent d4c2900590
commit 0347d9cf78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ pub fn write_keypair<W: Write>(
) -> Result<String, Box<dyn error::Error>> {
let keypair_bytes = keypair.0.to_bytes();
let serialized = serde_json::to_string(&keypair_bytes.to_vec())?;
writer.write_all(&serialized.clone().into_bytes())?;
writer.write_all(serialized.as_bytes())?;
Ok(serialized)
}