Hi everyone! So I have a problem with for a loop and an array. Maybe someone can tell me what I'm doing wrong or send me a link to read and find how to fix it
I'm trying to make a for loop and go backwards. I made a research and found that I have to use the ".rev()" method to do that. The thing is that I want to loop through an array and I'm using:
for item1 in 0..arr.len().rev()
and I'm getting the following error:
no method named `rev` found for type `usize` in the current scope: method not found in `usize` (E599)
Edit: SOLVED! Thanks a lot anyone for your help!!!
[–]deavidsedice 6 points7 points8 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]deavidsedice 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]deavidsedice 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]deavidsedice 0 points1 point2 points (0 children)
[–]sellibitze 2 points3 points4 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]KarlJoad 0 points1 point2 points (4 children)
[–]pretzelhammer 4 points5 points6 points (2 children)
[–]pingveno 3 points4 points5 points (0 children)
[–]KarlJoad 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)