diff --git a/borsh/src/schema.rs b/borsh/src/schema.rs index 8bf695351..66ef6970c 100644 --- a/borsh/src/schema.rs +++ b/borsh/src/schema.rs @@ -112,9 +112,8 @@ where { fn serialize(&self, writer: &mut W) -> IOResult<()> { let declaration = self.declaration(); - let definitions: BTreeMap = self + let definitions: BTreeMap<&Declaration, &Definition> = self .definitions() - .map(|(k, v)| (k.clone(), v.clone())) .collect(); BorshSerialize::serialize(declaration, writer)?; BorshSerialize::serialize(&definitions, writer)?;