Skip to content

Commit

Permalink
chore/docs: improve wording and fix typos (#5157)
Browse files Browse the repository at this point in the history
## Description

Smol docs update. Fixes:

- A typo in assembly docs.
- A typo in unit testing docs.
- Couple of code documentation typos.
  • Loading branch information
PaulRBerg authored Oct 2, 2023
1 parent db55f17 commit 103095e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/book/src/advanced/assembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn add_1(num: u32) -> u32 {
}
```

An `asm` block can only return a single register. If you really need to return more than one value, you can modify a tuple. Here's an example showing how can implement this `(u64, u64)`:
An `asm` block can only return a single register. If you really need to return more than one value, you can modify a tuple. Here's an example showing how you can implement this `(u64, u64)`:

```sway
{{#include ../../../../examples/asm_return_tuple_pointer/src/main.sw}}
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/testing/unit-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn test_fail() {
> **Note:** When running `forc test`, your contract will be built twice: first *without* unit tests in order to determine the contract's ID, then a second time *with* unit tests with the `CONTRACT_ID` provided to their namespace. This `CONTRACT_ID` can be used with the `abi` cast to enable contract calls within unit tests.
<!-- contract_id:example:end -->
Unit tests can call methods of external contracts if those contracts are added as contract dependencies, i.e. in the the [`contract-dependencies`](../forc/manifest_reference.md#the-contract-dependencies-section) section of the manifest file. An example of such calls is shown below:
Unit tests can call methods of external contracts if those contracts are added as contract dependencies, i.e. in the [`contract-dependencies`](../forc/manifest_reference.md#the-contract-dependencies-section) section of the manifest file. An example of such calls is shown below:

```sway
{{#include ../../../../examples/multi_contract_calls/caller/src/main.sw:multi_contract_calls}}
Expand Down
2 changes: 1 addition & 1 deletion sway-core/src/asm_generation/evm/evm_asm_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<'ir, 'eng> EvmAsmBuilder<'ir, 'eng> {
self.setup_free_memory_pointer(&mut s);

if is_payable {
// Get the the amount of ETH transferred to the contract by the parent contract,
// Get the amount of ETH transferred to the contract by the parent contract,
// or by a transaction and check for a non-payable contract. Revert if caller
// sent ether.
//
Expand Down
2 changes: 1 addition & 1 deletion sway-core/src/language/ty/declaration/declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ impl TyDecl {
}

/// friendly name string used for error reporting,
/// which consists of the the identifier for the declaration.
/// which consists of the identifier for the declaration.
pub fn friendly_name(&self, engines: &Engines) -> String {
let decl_engine = engines.de();
let type_engine = engines.te();
Expand Down

0 comments on commit 103095e

Please sign in to comment.