From 97451996e69a0bb8d98cfe77bd904d8033419ab9 Mon Sep 17 00:00:00 2001 From: Jakob Demler Date: Wed, 15 Feb 2017 21:21:31 +0100 Subject: [PATCH] fixed whitespace issues --- src/doc/book/src/procedural-macros.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/doc/book/src/procedural-macros.md b/src/doc/book/src/procedural-macros.md index e9777f9992f7..468a8f904a45 100644 --- a/src/doc/book/src/procedural-macros.md +++ b/src/doc/book/src/procedural-macros.md @@ -209,7 +209,9 @@ Ok so now, let's compile `hello-world`. Executing `cargo run` now yields: Hello, World! My name is FrenchToast Hello, World! My name is Waffles ``` + ## Custom Attributes + In some cases it might make sense to allow users some kind of configuration. For our example the user might want to overwrite the name that is printed in the `hello_world()` method. @@ -240,8 +242,8 @@ pub fn hello_world(input: TokenStream) -> TokenStream Multiple attributes can be specified that way. - ## Raising Errors + Let's assume that we do not want to accept `Enums` as input to our custom derive method. This condition can be easily checked with the help of `syn`.