Skip to content

Commit 3ecaf12

Browse files
fix(sncast): borrow schema serialization errors
1 parent 28fe362 commit 3ecaf12

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • crates/sncast/src/accounts/schema

crates/sncast/src/accounts/schema/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl DecodedAccountRegistry {
6666

6767
pub fn encode_v2(registry: &AccountRegistry) -> Result<Vec<u8>, AccountsError> {
6868
let file: v2::AccountsFile = registry.try_into()?;
69-
let mut output = serde_json::to_vec_pretty(&file).map_err(schema_error)?;
69+
let mut output = serde_json::to_vec_pretty(&file).map_err(|error| schema_error(&error))?;
7070
output.push(b'\n');
7171
Ok(output)
7272
}
@@ -80,7 +80,7 @@ fn deserialize<T: DeserializeOwned>(input: &[u8]) -> Result<T, AccountsError> {
8080
})
8181
}
8282

83-
fn schema_error(error: serde_json::Error) -> AccountsError {
83+
fn schema_error(error: &serde_json::Error) -> AccountsError {
8484
AccountsError::Schema {
8585
path: String::new(),
8686
message: error.to_string(),

0 commit comments

Comments
 (0)