How to allow unused variables in Rust

1 Answer

0 votes
#[allow(unused_variables)]

fn main() {
    let x = 10;
    let y = 25; // OK

    println!("{}", x);
}




/*
run:

10

*/

 



answered May 2, 2023 by avibootz

Related questions

1 answer 242 views
242 views asked May 2, 2023 by avibootz
1 answer 228 views
2 answers 302 views
2 answers 290 views
290 views asked Apr 15, 2023 by avibootz
1 answer 214 views
2 answers 329 views
...