Skip to content

Commit

Permalink
Add must_use to std docs (#583)
Browse files Browse the repository at this point in the history
Closes: #407 

Adds `must_use` functionality and documentation for std docs.
  • Loading branch information
Midnightific authored Feb 5, 2024
1 parent b803dc6 commit 231ad62
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/src/usage/std.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ Example:
type: any
```
#### "must_use"
This field is used for checking if the return value of a function is used.
- `false` - The default. The return value of this function does not need to be used.
- `true` - The return value of this function must be used.

Example:
```yml
tostring:
args:
- type: any
must_use: true
```

#### Argument types
- `"any"` - Allows any value.
- `"bool"`, `"function"`, `"nil"`, `"number"`, `"string"`, `"table"` - Expects a value of the respective type.
Expand Down

0 comments on commit 231ad62

Please sign in to comment.