Commit message · Roman Zeydechore(core/embed/rust): use `as_slice()` instead of `as_ref()`
Since `rust-bitcoin` defines `impl AsRef<PushBytes> for [u8; $len]`[^1],
the existing code fails with:
```
error[E0282]: type annotations needed
--> rust/src/translations/obj.rs:65:53
|
65 | Qstr::MP_QSTR_data_hash => header.data_hash.as_ref().try_into()?,
<snip>
but trait `AsRef<miniscript::bitcoin::script::PushBytes>` is implemented for it
--> /home/rzeyde/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bitcoin-0.32.102/src/blockdata/script/push_bytes.rs:156:17
|
156 | impl AsRef<PushBytes> for [u8; $len] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
184 | / from_array! {
185 | | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
186 | | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
187 | | 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
188 | | 71, 72, 73, 74, 75, 76
189 | | }
| |_____- in this macro invocation
= help: for that trait implementation, expected `miniscript::bitcoin::script::PushBytes`, found `[&u8]`
= note: this error originates in the macro `from_array` (in Nightly builds, run with -Z macro-backtrace for more info)
```
[no changelog]
[^1]: https://github.com/rust-bitcoin/rust-bitcoin/blob/1cbf4bd62ea99c558c6d8ef794edbd984a2a4684/primitives/src/script/push_bytes.rs#L194
93/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queuedtranslation-only discount