Shadowing

In Rust, you can shadow a variable by creating another let binding with the same name. This is usually okay, except when we maybe only wanted to mutate a variable, for example. In general, you should avoid this practice and only use it where it helps readability.

You can use the shadow_unrelated, shadow_same, and shadow_reuse lints and warn this behavior by default, then allow it for specific situations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.230.81