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 245 views
245 views asked May 2, 2023 by avibootz
1 answer 230 views
2 answers 304 views
2 answers 291 views
291 views asked Apr 15, 2023 by avibootz
1 answer 217 views
2 answers 329 views
...