Skip to content

Commit 4e48981

Browse files
authored
Update overload.md (#184)
1 parent 071c8e0 commit 4e48981

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/macros/overload.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
macro_rules! test {
88
// 参数不需要使用逗号隔开。
99
// 参数可以任意组合!
10-
($left:expr; and $right:expr) => (
10+
($left:expr; and $right:expr) => {
1111
println!("{:?} and {:?} is {:?}",
1212
stringify!($left),
1313
stringify!($right),
1414
$left && $right)
15-
);
15+
};
1616
// ^ 每个分支都必须以分号结束。
17-
($left:expr; or $right:expr) => (
17+
($left:expr; or $right:expr) => {
1818
println!("{:?} or {:?} is {:?}",
1919
stringify!($left),
2020
stringify!($right),
2121
$left || $right)
22-
);
22+
};
2323
}
2424
2525
fn main() {

0 commit comments

Comments
 (0)