"let mut x=10;" has warning! why?


I’m a green hand,please help me.Thanks!
Questions are as follows:

rustc 1.16.0 (30cf806ef 2017-03-10)


This is just a warning, not an error. So your code works. The compiler has some warnings for when you’re doing things that don’t really make sense to do.

Its just telling you that you never actually use the x while it is assigned to 10. You could have just as easily said let x = 20; instead.


Yes, thank you very much!Rust compiler is very powerful!!:wink: