Cargo fmt keeps adding commas after methods definition at methods! macro
Closed this issue · 1 comments
abinoam commented
Is it possible to make the methods!
(and unsafe_methods!
) macro accept both with or without commas?
(This would help a Rust/Rutie newbie like me)
It would be desirable to have this possibility? (Or is there another way to tackle this situation? A cargo fmt configuration, for example?)
Is it easily accomplish-able? If so, I could study Rust macros and try to open a PR myself.
Bellow a git diff
after a cargo fmt
diff --git a/src/lib.rs b/src/lib.rs
index c6f733c..83fdde3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -73,14 +73,12 @@ methods!(
}
array
- }
-
+ },
fn pub_to_s() -> RString {
let matrix_str = rtself.get_data(&*MATRIX_WRAPPER_INSTANCE).to_s();
RString::from(matrix_str)
- }
-
+ },
fn pub_dot(other: MatrixRs) -> MatrixRs {
let other = other.unwrap_or_rb_raise();
let other_matrix = other.get_data(&*MATRIX_WRAPPER_INSTANCE);
danielpclark commented