Skip to content

Commit

Permalink
fix option syntax (#104)
Browse files Browse the repository at this point in the history
* fix option syntax
* Update reference/src/control-flow/loops.md
  • Loading branch information
yanganto authored Jan 20, 2025
1 parent 051d041 commit 6f9607f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reference/src/control-flow/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ fun find_position(values: &vector<u64>, target_value: u64): Option<u64> {
};
if (found) {
Option::Some(i)
option::some(i)
} else {
Option::None
option::none<u64>()
}
}
```
Expand Down Expand Up @@ -150,9 +150,9 @@ fun find_position(values: &vector<u64>, target_value: u64): Option<u64> {
loop {
if (vector::borrow(values, i) == &target_value) {
break Option::Some(i)
break option::some(i)
} else if (i >= size) {
break Option::None
break option::none()
};
i = i + 1;
}
Expand Down

0 comments on commit 6f9607f

Please sign in to comment.