@codama/renderers-rust 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,12 +145,12 @@ pub fn fetch_all_{{ account.name | snakeCase }}(
145
145
  addresses: &[solana_pubkey::Pubkey],
146
146
  ) -> Result<Vec<crate::shared::DecodedAccount<{{ account.name | pascalCase }}>>, std::io::Error> {
147
147
  let accounts = rpc.get_multiple_accounts(addresses)
148
- .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
148
+ .map_err(|e| std::io::Error::other(e.to_string()))?;
149
149
  let mut decoded_accounts: Vec<crate::shared::DecodedAccount<{{ account.name | pascalCase }}>> = Vec::new();
150
150
  for i in 0..addresses.len() {
151
151
  let address = addresses[i];
152
152
  let account = accounts[i].as_ref()
153
- .ok_or(std::io::Error::new(std::io::ErrorKind::Other, format!("Account not found: {}", address)))?;
153
+ .ok_or(std::io::Error::other(format!("Account not found: {address}")))?;
154
154
  let data = {{ account.name | pascalCase }}::from_bytes(&account.data)?;
155
155
  decoded_accounts.push(crate::shared::DecodedAccount { address, account: account.clone(), data });
156
156
  }
@@ -172,7 +172,7 @@ pub fn fetch_all_maybe_{{ account.name | snakeCase }}(
172
172
  addresses: &[solana_pubkey::Pubkey],
173
173
  ) -> Result<Vec<crate::shared::MaybeAccount<{{ account.name | pascalCase }}>>, std::io::Error> {
174
174
  let accounts = rpc.get_multiple_accounts(addresses)
175
- .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
175
+ .map_err(|e| std::io::Error::other(e.to_string()))?;
176
176
  let mut decoded_accounts: Vec<crate::shared::MaybeAccount<{{ account.name | pascalCase }}>> = Vec::new();
177
177
  for i in 0..addresses.len() {
178
178
  let address = addresses[i];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codama/renderers-rust",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Renders Rust clients for your programs",
5
5
  "exports": {
6
6
  "types": "./dist/types/index.d.ts",