Skip to content

Commit

Permalink
Merge pull request #182 from lzutao/patch-1
Browse files Browse the repository at this point in the history
Fix syntax highlighting in macro guide
  • Loading branch information
Centril committed Jul 6, 2019
2 parents dbd936b + 4729949 commit f6c8b92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rust-2018/macros/at-most-once.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ In Rust 2018, we have made a couple of changes to the macros-by-example syntax.

For example, consider the following Rust 2015 code:

```rust2018
```rust
macro_rules! foo {
($a:ident, $b:expr) => {
println!("{}", $a);
println!("{}", $b);
}
};
($a:ident) => {
println!("{}", $a);
}
Expand All @@ -29,7 +29,7 @@ but you need a whole other matcher to represent this possibility. This is
annoying if your matchers are long. In Rust 2018, one can simply write the
following:

```rust2018
```rust
macro_rules! foo {
($a:ident $(, $b:expr)?) => {
println!("{}", $a);
Expand Down

0 comments on commit f6c8b92

Please sign in to comment.