Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yash251 committed Dec 26, 2024
1 parent cf7b666 commit b278f16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ The left side of the arrow `=>` is the pattern that we are matching on and the r

We check each arm starting from `0` and make our way down until we either find a match on our pattern or we reach the `catch_all` case.

The `|` operator can be used to produce a pattern that is a disjuction of other patterns.
The `|` operator can be used to produce a pattern that is a disjunction of other patterns.

The `catch_all` case is equivalent to an `else` in [if expressions](../if-expressions.md) and it does not have to be called `catch_all`. Any pattern declared after a `catch_all` case will not be matched because once the compiler sees the first `catch_all` it stop performing further checks.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Address Namespace

Sway utilizies namespaces to distinguish between address types.
Sway utilizes namespaces to distinguish between address types.

Having multiple address types enforces type-safety and expands the range of values that an address can take because the same value can be used across multiple types.

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/src/documentation/operations/reentrancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ Sway provides a stateless [re-entrancy](https://fuellabs.github.io/sway-libs/boo
To use the guard we must import it.

```sway
{{#include ../../code/operations/re_entrency/src/main.sw:import}}
{{#include ../../code/operations/re_entrancy/src/main.sw:import}}
```

Then call it in a contract function.

```sway
{{#include ../../code/operations/re_entrency/src/main.sw:guard}}
{{#include ../../code/operations/re_entrancy/src/main.sw:guard}}
```

## Checks-Effects-Interactions Pattern

The pattern states that all state (storage) changes should be made before a call is made.

```sway
{{#include ../../code/operations/re_entrency/src/main.sw:check}}
{{#include ../../code/operations/re_entrancy/src/main.sw:check}}
```

0 comments on commit b278f16

Please sign in to comment.