#[cfg(test)]
mod tests {
use test_case::test_case;
#[test_case(1, 1)]
fn square(x: i32, y: i32) {
assert_eq!(x*x, y);
}
}
Messages from clippy,
warning: unneeded unit expression
--> src/main.rs:9:5
|
9 | #[test_case(1, 1)]
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::unused_unit)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
= note: this warning originates in the attribute macro `test_case` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 1 warning emitted
I think this warning should be suppressed in macro, or we should modify the macro not to use unit expressions, if possible.
Clippy raises a warning to the following code.
Messages from clippy,
I think this warning should be suppressed in macro, or we should modify the macro not to use unit expressions, if possible.