joystream icon indicating copy to clipboard operation
joystream copied to clipboard

Fix use of array into iter

Open mnaamani opened this issue 6 years ago • 3 comments

https://github.com/Joystream/substrate-runtime-joystream/blob/385a376ed64e565ad410be76a7e424f0de340d66/src/lib.rs#L331

this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.

note: `#[warn(array_into_iter)]` on by default
warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>rustc(array_into_iter)

mnaamani avatar Mar 06 '20 09:03 mnaamani

https://github.com/rust-lang/rust/issues/66145 Most probably this warning originates from srml > staking > reward-curve module. Figured out the actual place, where it was introduced. Screenshot from 2020-04-21 19-17-43 I see 2 possible solutions here:

  • Wait for the moment, when we`ll update to the most recent substrate version, where this error is already fixed.
  • Fork reward-curve module, replacing into_iter with iter

iorveth avatar Apr 21 '20 16:04 iorveth

Def. lets wait, nice work!

bedeho avatar Apr 21 '20 18:04 bedeho

This is most likely resolved in https://github.com/Joystream/joystream/pull/1075 when updating substrate

mnaamani avatar Jul 30 '20 08:07 mnaamani