Skip to content

Commit

Permalink
chore: avoid clone in impl BorshSerialize for BorshSchemaContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Jun 29, 2023
1 parent 96fc503 commit a78b3bb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions borsh/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ where
{
fn serialize<W: Write>(&self, writer: &mut W) -> IOResult<()> {
let declaration = self.declaration();
let definitions: BTreeMap<Declaration, Definition> = self
let definitions: BTreeMap<&Declaration, &Definition> = self
.definitions()
.map(|(k, v)| (k.clone(), v.clone()))
.collect();
BorshSerialize::serialize(declaration, writer)?;
BorshSerialize::serialize(&definitions, writer)?;
Expand Down

0 comments on commit a78b3bb

Please sign in to comment.