Skip to content

Commit 977483e

Browse files
fake-rickYangFong
andauthored
Update dry.md (#181)
* Update dry.md * Update dry.md --------- Co-authored-by: YangQi <[email protected]>
1 parent 0c2acb6 commit 977483e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/macros/dry.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ use std::ops::{Add, Mul, Sub};
77
88
macro_rules! assert_equal_len {
99
// `tt`(token tree,标记树)指示符表示运算符和标记。
10-
($a:ident, $b: ident, $func:ident, $op:tt) => (
10+
($a:ident, $b: ident, $func:ident, $op:tt) => {
1111
assert!($a.len() == $b.len(),
1212
"{:?}: dimension mismatch: {:?} {:?} {:?}",
1313
stringify!($func),
1414
($a.len(),),
1515
stringify!($op),
1616
($b.len(),));
17-
)
17+
};
1818
}
1919
2020
macro_rules! op {
21-
($func:ident, $bound:ident, $op:tt, $method:ident) => (
21+
($func:ident, $bound:ident, $op:tt, $method:ident) => {
2222
fn $func<T: $bound<T, Output=T> + Copy>(xs: &mut Vec<T>, ys: &Vec<T>) {
2323
assert_equal_len!(xs, ys, $func, $op);
2424
@@ -27,7 +27,7 @@ macro_rules! op {
2727
// *x = x.$method(*y);
2828
}
2929
}
30-
)
30+
};
3131
}
3232
3333
// 实现 `add_assign`、`mul_assign` 和 `sub_assign` 等函数。

0 commit comments

Comments
 (0)