@@ -39,7 +39,8 @@ pub trait ElectrumApi {
3939 /// Takes a list of `txids` and returns a list of transactions.
4040 fn batch_transaction_get < ' t , I > ( & self , txids : I ) -> Result < Vec < Transaction > , Error >
4141 where
42- I : IntoIterator < Item = & ' t Txid > + Clone ,
42+ I : IntoIterator + Clone ,
43+ I :: Item : Borrow < & ' t Txid > ,
4344 {
4445 self . batch_transaction_get_raw ( txids) ?
4546 . iter ( )
@@ -52,7 +53,8 @@ pub trait ElectrumApi {
5253 /// Takes a list of `heights` of blocks and returns a list of headers.
5354 fn batch_block_header < I > ( & self , heights : I ) -> Result < Vec < BlockHeader > , Error >
5455 where
55- I : IntoIterator < Item = u32 > + Clone ,
56+ I : IntoIterator + Clone ,
57+ I :: Item : Borrow < u32 > ,
5658 {
5759 self . batch_block_header_raw ( heights) ?
5860 . iter ( )
@@ -110,7 +112,7 @@ pub trait ElectrumApi {
110112 /// Batch version of [`script_subscribe`](#method.script_subscribe).
111113 ///
112114 /// Takes a list of scripts and returns a list of script status responses.
113- ///
115+ ///
114116 /// Note you should pass a reference to a collection because otherwise an expensive clone is made
115117 fn batch_script_subscribe < ' s , I > ( & self , scripts : I ) -> Result < Vec < Option < ScriptStatus > > , Error >
116118 where
@@ -136,7 +138,8 @@ pub trait ElectrumApi {
136138 /// Takes a list of scripts and returns a list of balance responses.
137139 fn batch_script_get_balance < ' s , I > ( & self , scripts : I ) -> Result < Vec < GetBalanceRes > , Error >
138140 where
139- I : IntoIterator < Item = & ' s Script > + Clone ;
141+ I : IntoIterator + Clone ,
142+ I :: Item : Borrow < & ' s Script > ;
140143
141144 /// Returns the history for a *scriptPubKey*
142145 fn script_get_history ( & self , script : & Script ) -> Result < Vec < GetHistoryRes > , Error > ;
@@ -146,7 +149,8 @@ pub trait ElectrumApi {
146149 /// Takes a list of scripts and returns a list of history responses.
147150 fn batch_script_get_history < ' s , I > ( & self , scripts : I ) -> Result < Vec < Vec < GetHistoryRes > > , Error >
148151 where
149- I : IntoIterator < Item = & ' s Script > + Clone ;
152+ I : IntoIterator + Clone ,
153+ I :: Item : Borrow < & ' s Script > ;
150154
151155 /// Returns the list of unspent outputs for a *scriptPubKey*
152156 fn script_list_unspent ( & self , script : & Script ) -> Result < Vec < ListUnspentRes > , Error > ;
@@ -159,7 +163,8 @@ pub trait ElectrumApi {
159163 scripts : I ,
160164 ) -> Result < Vec < Vec < ListUnspentRes > > , Error >
161165 where
162- I : IntoIterator < Item = & ' s Script > + Clone ;
166+ I : IntoIterator + Clone ,
167+ I :: Item : Borrow < & ' s Script > ;
163168
164169 /// Gets the raw bytes of a transaction with `txid`. Returns an error if not found.
165170 fn transaction_get_raw ( & self , txid : & Txid ) -> Result < Vec < u8 > , Error > ;
@@ -169,22 +174,25 @@ pub trait ElectrumApi {
169174 /// Takes a list of `txids` and returns a list of transactions raw bytes.
170175 fn batch_transaction_get_raw < ' t , I > ( & self , txids : I ) -> Result < Vec < Vec < u8 > > , Error >
171176 where
172- I : IntoIterator < Item = & ' t Txid > + Clone ;
177+ I : IntoIterator + Clone ,
178+ I :: Item : Borrow < & ' t Txid > ;
173179
174180 /// Batch version of [`block_header_raw`](#method.block_header_raw).
175181 ///
176182 /// Takes a list of `heights` of blocks and returns a list of block header raw bytes.
177183 fn batch_block_header_raw < I > ( & self , heights : I ) -> Result < Vec < Vec < u8 > > , Error >
178184 where
179- I : IntoIterator < Item = u32 > + Clone ;
185+ I : IntoIterator + Clone ,
186+ I :: Item : Borrow < u32 > ;
180187
181188 /// Batch version of [`estimate_fee`](#method.estimate_fee).
182189 ///
183190 /// Takes a list of `numbers` of blocks and returns a list of fee required in
184191 /// **Satoshis per kilobyte** to confirm a transaction in the given number of blocks.
185192 fn batch_estimate_fee < I > ( & self , numbers : I ) -> Result < Vec < f64 > , Error >
186193 where
187- I : IntoIterator < Item = usize > + Clone ;
194+ I : IntoIterator + Clone ,
195+ I :: Item : Borrow < usize > ;
188196
189197 /// Broadcasts the raw bytes of a transaction to the network.
190198 fn transaction_broadcast_raw ( & self , raw_tx : & [ u8 ] ) -> Result < Txid , Error > ;
0 commit comments