Write docs; Add missing docs warning

This commit is contained in:
Jeff 2024-01-30 14:48:38 -05:00
parent 0ba3ed51e0
commit 7c9be2151d
2 changed files with 26 additions and 11 deletions

View File

@ -353,9 +353,22 @@ stdout_message = new Message {
The `option(type)` type is expected to be either `some(value)` or `none`. The type of the value
inside the `some` is always specified.
```dust
result <option(str)> = none
for file in fs:read_dir("./") {
if file:size > 100 {
result = some(file:path)
break
}
}
output(result)
```
```dust
get_line_break_index(text <str>) <some(int)> {
str:find(text, '\n')
str:find(text, '\n')
}
```
@ -364,20 +377,20 @@ get_line_break_index(text <str>) <some(int)> {
Custom types such as **structures** are referenced by their variable identifier.
```dust
struct File {
path <str>
size <int>
type <str>
File = struct {
path <str>
size <int>
type <str>
}
print_file_info(file <File>) <none> {
info = file:path
+ '\n'
+ file:size
+ '\n'
+ file:type
info = file:path
+ '\n'
+ file:size
+ '\n'
+ file:type
output(info)
output(info)
}
```

View File

@ -1,3 +1,5 @@
#![warn(missing_docs)]
//! The Dust library is used to parse, format and run dust source code.
//!
//! See the [interpret] module for more information.