@@ -132,23 +132,23 @@ impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for {{ account.
132132pub fn fetch_{{ account .name | snakeCase }} (
133133 rpc: &solana_client::rpc_client::RpcClient,
134134 address: &Pubkey,
135- ) -> Result<super ::DecodedAccount <{{ account.name | pascalCase }} >, Error> {
136- let accounts = fetch_all_{{ account .name | snakeCase }} (rpc, vec![address])?;
135+ ) -> Result<crate ::DecodedAccount <{{ account.name | pascalCase }} >, std::io:: Error> {
136+ let accounts = fetch_all_{{ account .name | snakeCase }} (rpc, vec![* address])?;
137137 Ok(accounts[0].clone())
138138}
139139
140140#[cfg(feature = "fetch")]
141141pub fn fetch_all_{{ account .name | snakeCase }} (
142142 rpc: &solana_client::rpc_client::RpcClient,
143143 addresses: Vec<Pubkey >,
144- ) -> Result<Vec <super ::DecodedAccount <{{ account.name | pascalCase }} >>, Error> {
144+ ) -> Result<Vec <crate ::DecodedAccount <{{ account.name | pascalCase }} >>, std::io:: Error> {
145145 let accounts = rpc.get_multiple_accounts(&addresses)?;
146- let mut decoded_accounts: Vec<super ::DecodedAccount <{{ account.name | pascalCase }} >> = Vec::new();
146+ let mut decoded_accounts: Vec<crate ::DecodedAccount <{{ account.name | pascalCase }} >> = Vec::new();
147147 for i in 0..addresses.len() {
148148 let address = addresses[i];
149149 let account = accounts[i].as_ref().ok_or(format!("Account not found: {}", address))?;
150150 let data = {{ account .name | pascalCase }} ::from_bytes(&account.data)?;
151- decoded_accounts.push(super ::DecodedAccount { address, account: account.clone(), data });
151+ decoded_accounts.push(crate ::DecodedAccount { address, account: account.clone(), data });
152152 }
153153 Ok(decoded_accounts)
154154}
@@ -157,25 +157,25 @@ pub fn fetch_all_{{ account.name | snakeCase }}(
157157pub fn fetch_maybe_{{ account .name | snakeCase }} (
158158 rpc: &solana_client::rpc_client::RpcClient,
159159 address: &Pubkey,
160- ) -> Result<super ::MaybeAccount <{{ account.name | pascalCase }} >, Error> {
161- let accounts = fetch_all_maybe_{{ account .name | snakeCase }} (rpc, vec![address])?;
160+ ) -> Result<crate ::MaybeAccount <{{ account.name | pascalCase }} >, std::io:: Error> {
161+ let accounts = fetch_all_maybe_{{ account .name | snakeCase }} (rpc, vec![* address])?;
162162 Ok(accounts[0].clone())
163163}
164164
165165#[cfg(feature = "fetch")]
166166pub fn fetch_all_maybe_{{ account .name | snakeCase }} (
167167 rpc: &solana_client::rpc_client::RpcClient,
168168 addresses: Vec<Pubkey >,
169- ) -> Result<Vec <super ::MaybeAccount <{{ account.name | pascalCase }} >>, Error> {
169+ ) -> Result<Vec <crate ::MaybeAccount <{{ account.name | pascalCase }} >>, std::io:: Error> {
170170 let accounts = rpc.get_multiple_accounts(&addresses)?;
171- let mut decoded_accounts: Vec<super ::MaybeAccount <{{ account.name | pascalCase }} >> = Vec::new();
171+ let mut decoded_accounts: Vec<crate ::MaybeAccount <{{ account.name | pascalCase }} >> = Vec::new();
172172 for i in 0..addresses.len() {
173173 let address = addresses[i];
174174 if let Some(account) = accounts[i].as_ref() {
175175 let data = {{ account .name | pascalCase }} ::from_bytes(&account.data)?;
176- decoded_accounts.push(super ::MaybeAccount::Exists(super ::DecodedAccount { address, account: account.clone(), data }));
176+ decoded_accounts.push(crate ::MaybeAccount::Exists(crate ::DecodedAccount { address, account: account.clone(), data }));
177177 } else {
178- decoded_accounts.push(super ::MaybeAccount::NotFound(address));
178+ decoded_accounts.push(crate ::MaybeAccount::NotFound(address));
179179 }
180180 }
181181 Ok(decoded_accounts)
0 commit comments