Commit a9fc126
committed
Merge rust-bitcoin#4938: fix: resolve clippy::len_zero lint in Instructions::size_hint
b5d4f4f fix: resolve clippy::len_zero lint in Instructions::size_hint (Bugar)
Pull request description:
Replace `self.data.len() == 0` with `self.data.as_slice().is_empty()` to fix clippy::len_zero warning in the size_hint implementation for Instructions iterator.
This addresses the Clippy lint that recommends using is_empty() instead of comparing len() to zero, which is more idiomatic Rust. Uses stable slice.is_empty() via as_slice() to avoid unstable exact_size_is_empty feature.
Fixes: clippy::len_zero warning in bitcoin/src/blockdata/script/instruction.rs:193
ACKs for top commit:
apoelstra:
ACK b5d4f4f; successfully ran local tests
Tree-SHA512: bcbdb6573169ce6e742df5d09af2db877d469cd518eb6b445e824e2b7b330a4955311787683c7a5c362b462aec0bdde1f3b3dd0b4593f721e6156c29a18d4e321 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
0 commit comments