Skip to content

Commit b7a2f57

Browse files
committed
Add more default value documentation
1 parent 47ce85b commit b7a2f57

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/macros/object.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,17 @@ default value, _or_ make the type into an `Option<>`, the argument becomes
215215
optional. For example:
216216
217217
```text
218-
arg_name: String -- required
219-
arg_name: Option<String> -- optional, None if unspecified
220-
arg_name = "default": String -- optional "default" if unspecified
218+
arg_name: i64 -- required
219+
arg_name: Option<i64> -- optional, None if unspecified
220+
arg_name = 123: i64 -- optional, "123" if unspecified
221+
```
222+
223+
Due to some syntactical limitations in the macros, you must parentesize more
224+
complex default value expressions:
225+
226+
```text
227+
arg_name = (Point { x: 1, y: 2 }): Point
228+
arg_name = ("default".to_owned()): String
221229
```
222230
223231
[1]: struct.Executor.html

0 commit comments

Comments
 (0)