From 231ad623afda00a7b2760b76fe4c1b1c881d5ee3 Mon Sep 17 00:00:00 2001 From: Griffin Date: Mon, 5 Feb 2024 08:01:07 +0800 Subject: [PATCH] Add `must_use` to std docs (#583) Closes: #407 Adds `must_use` functionality and documentation for std docs. --- docs/src/usage/std.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/src/usage/std.md b/docs/src/usage/std.md index cc221491..93e06247 100644 --- a/docs/src/usage/std.md +++ b/docs/src/usage/std.md @@ -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.