1

When using a for loop

for i in 1..10 {}

The compiler tells me to prefix i like this: _i.

What am I actually conveying by putting the underscore in front of variables or functions?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Viktor
  • 61
  • 6
  • 4
    The compiler message *tells you exactly what is happening*: `= note: #[warn(unused_variables)] on by default. to avoid this warning, consider using \`_i\` instead`. It's an unused variable, and an underscore conveys that you don't care that the variable is unused. – Shepmaster Jan 25 '18 at 19:44

0 Answers0