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 243 views
243 views asked May 2, 2023 by avibootz
1 answer 229 views
2 answers 303 views
2 answers 291 views
291 views asked Apr 15, 2023 by avibootz
1 answer 216 views
2 answers 329 views
...