From 103095e1f8332a0bbfaf0f5627973d7ea118050c Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Mon, 2 Oct 2023 03:51:16 +0300 Subject: [PATCH] chore/docs: improve wording and fix typos (#5157) ## Description Smol docs update. Fixes: - A typo in assembly docs. - A typo in unit testing docs. - Couple of code documentation typos. --- docs/book/src/advanced/assembly.md | 2 +- docs/book/src/testing/unit-testing.md | 2 +- sway-core/src/asm_generation/evm/evm_asm_builder.rs | 2 +- sway-core/src/language/ty/declaration/declaration.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/book/src/advanced/assembly.md b/docs/book/src/advanced/assembly.md index 90b1bc63fb3..313191d0f01 100644 --- a/docs/book/src/advanced/assembly.md +++ b/docs/book/src/advanced/assembly.md @@ -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}} diff --git a/docs/book/src/testing/unit-testing.md b/docs/book/src/testing/unit-testing.md index c94930e084c..e6f95b2201e 100644 --- a/docs/book/src/testing/unit-testing.md +++ b/docs/book/src/testing/unit-testing.md @@ -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. -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}} diff --git a/sway-core/src/asm_generation/evm/evm_asm_builder.rs b/sway-core/src/asm_generation/evm/evm_asm_builder.rs index de3215b3d61..ac96989e500 100644 --- a/sway-core/src/asm_generation/evm/evm_asm_builder.rs +++ b/sway-core/src/asm_generation/evm/evm_asm_builder.rs @@ -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. // diff --git a/sway-core/src/language/ty/declaration/declaration.rs b/sway-core/src/language/ty/declaration/declaration.rs index f34933d10ec..af9a1857ef3 100644 --- a/sway-core/src/language/ty/declaration/declaration.rs +++ b/sway-core/src/language/ty/declaration/declaration.rs @@ -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();