Skip to content

Commit 83386c0

Browse files
committed
Improve documentation of builtin functions
Relates to #38
1 parent 2f7d1c2 commit 83386c0

File tree

3 files changed

+81
-14
lines changed

3 files changed

+81
-14
lines changed

Cargo.lock

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,9 @@ This crate offers a set of builtin functions.
214214
|------------|-----------------|-------------|
215215
| min | >= 1 | Returns the minimum of the arguments |
216216
| max | >= 1 | Returns the maximum of the arguments |
217-
| len | 1 | Return the character length of string argument |
218-
| str::regex_matches | 2 | Returns true if first string argument matches regex in second |
219-
| str::regex_replace | 3 | Returns string with matches replaced by third argument |
220-
| str::to_lowercase | 1 | Returns lower-case version of string |
221-
| str::to_uppercase | 1 | Returns upper-case version of string |
222-
| str::trim | 1 | Strips whitespace from start and end of string |
223217

224218
The `min` and `max` functions can deal with a mixture of integer and floating point arguments.
225-
They return the result as the type it was passed into the function. The regex functions require
226-
feature flag `regex_support`.
219+
They return the result as the type it was passed into the function.
227220

228221
### Values
229222

src/lib.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
//! | * | 100 | Product |
121121
//! | / | 100 | Division |
122122
//! | % | 100 | Modulo |
123-
//! | + | 95 | Sum |
123+
//! | + | 95 | Sum or String Concatenation |
124124
//! | - | 95 | Difference |
125125
//! | < | 80 | Lower than |
126126
//! | \> | 80 | Greater than |
@@ -197,13 +197,22 @@
197197
//!
198198
//! This crate offers a set of builtin functions.
199199
//!
200-
//! | Identifier | Argument Amount | Description |
201-
//! |------------|-----------------|-------------|
202-
//! | min | >= 1 | Returns the minimum of the arguments |
203-
//! | max | >= 1 | Returns the maximum of the arguments |
200+
//! | Identifier | Argument Amount | Argument Types | Description |
201+
//! |------------|-----------------|----------------|-------------|
202+
//! | `min` | >= 1 | Numeric | Returns the minimum of the arguments |
203+
//! | `max` | >= 1 | Numeric | Returns the maximum of the arguments |
204+
//! | `len` | 1 | String | Returns the character length of a string |
205+
//! | `str::regex_matches` | 2 | String, String | Returns true if the first argument matches the regex in the second argument |
206+
//! | `str::regex_replace` | 3 | String, String, String | Returns the first argument with all matches of the regex in the second argument replaced by the third argument |
207+
//! | `str::to_lowercase` | 1 | String | Returns the lower-case version of the string |
208+
//! | `str::to_uppercase` | 1 | String | Returns the upper-case version of the string |
209+
//! | `str::trim` | 1 | String | Strips whitespace from the start and the end of the string |
204210
//!
205211
//! The `min` and `max` functions can deal with a mixture of integer and floating point arguments.
206-
//! They return the result as the type it was passed into the function.
212+
//! If the maximum or minimum is an integer, then an integer is returned.
213+
//! Otherwise, a float is returned.
214+
//!
215+
//! The regex functions require the feature flag `regex_support`.
207216
//!
208217
//! ### Values
209218
//!

0 commit comments

Comments
 (0)