From 847c0d332749e260e387f10ae8cdb6d27d06156a Mon Sep 17 00:00:00 2001 From: withbest Date: Fri, 16 Aug 2024 05:07:31 +0900 Subject: [PATCH] chore: fix some comments (#271) ## Type of change - Documentation ## Changes - fix some comments ## Notes - Note 1 ## Related Issues Closes #\ ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. - [ ] I have updated the changelog to reflect the changes on this PR. Signed-off-by: withbest Co-authored-by: Cameron Carstens --- docs/contributing-book/src/code_docs/naming-components.md | 6 +++--- docs/contributing-book/src/pull-requests/creating-pr.md | 2 +- docs/contributing-book/src/pull-requests/index.md | 2 +- libs/src/reentrancy.sw | 4 ++-- libs/src/signed_integers/errors.sw | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/contributing-book/src/code_docs/naming-components.md b/docs/contributing-book/src/code_docs/naming-components.md index 7b5a058c..bbeb5336 100644 --- a/docs/contributing-book/src/code_docs/naming-components.md +++ b/docs/contributing-book/src/code_docs/naming-components.md @@ -26,11 +26,11 @@ Using a single character to name a variable conveys little to no information to - Is this a throw away variable? - What is the variable meant to represent where ever it is used? -- Does it make sense to call it by the chosen character e.g. `x` when referring to forumlas? +- Does it make sense to call it by the chosen character e.g. `x` when referring to formulas? -### Ambigious Abbreviations +### Ambiguous Abbreviations -A common mistake is to abbreviate a variable when it does not need to be abbreviated or when the abbreviation may be ambigious. +A common mistake is to abbreviate a variable when it does not need to be abbreviated or when the abbreviation may be ambiguous. For example, in the context of an industry that deals with temperature sensors what does the variable `temp` refer to? diff --git a/docs/contributing-book/src/pull-requests/creating-pr.md b/docs/contributing-book/src/pull-requests/creating-pr.md index 351de8ae..3742ceb9 100644 --- a/docs/contributing-book/src/pull-requests/creating-pr.md +++ b/docs/contributing-book/src/pull-requests/creating-pr.md @@ -60,7 +60,7 @@ If there is an issue that the pull request is working off of then it's a good pr For example, issue number `123` would be referenced in the description as `closes #123`. -Additionally, referencing the issue that the pull request is based on allows the reviewer to easily click on the link which will take them to the issue. This makes it easy to see the problem in detail and any discussion that occured. +Additionally, referencing the issue that the pull request is based on allows the reviewer to easily click on the link which will take them to the issue. This makes it easy to see the problem in detail and any discussion that occurred. ### Merging the Pull Request diff --git a/docs/contributing-book/src/pull-requests/index.md b/docs/contributing-book/src/pull-requests/index.md index b5e23cf3..9feb66f4 100644 --- a/docs/contributing-book/src/pull-requests/index.md +++ b/docs/contributing-book/src/pull-requests/index.md @@ -1,6 +1,6 @@ # Pull Requests -A pull request is a term used to identify when a piece of work is ready to be pulled into and merged with another piece of work. This funtionality is especially useful when collaborating with others because it allows a review process to take place. +A pull request is a term used to identify when a piece of work is ready to be pulled into and merged with another piece of work. This functionality is especially useful when collaborating with others because it allows a review process to take place. In order to create a high quality pull request there are a couple areas that need to be considered: diff --git a/libs/src/reentrancy.sw b/libs/src/reentrancy.sw index 651fcd75..39757f41 100644 --- a/libs/src/reentrancy.sw +++ b/libs/src/reentrancy.sw @@ -41,7 +41,7 @@ pub fn reentrancy_guard() { /// /// # Returns /// -/// * [bool] - `true` if reentrancy pattern has occured. +/// * [bool] - `true` if reentrancy pattern has occurred. /// /// # Examples /// @@ -58,7 +58,7 @@ pub fn is_reentrant() -> bool { let this_id = ContractId::this(); // Reentrancy cannot occur in an external context. If not detected by the time we get to the - // bottom of the call_frame stack, then no reentrancy has occured. + // bottom of the call_frame stack, then no reentrancy has occurred. let mut call_frame_pointer = frame_ptr(); if !call_frame_pointer.is_null() { call_frame_pointer = get_previous_frame_pointer(call_frame_pointer); diff --git a/libs/src/signed_integers/errors.sw b/libs/src/signed_integers/errors.sw index 0dc93235..2846ee00 100644 --- a/libs/src/signed_integers/errors.sw +++ b/libs/src/signed_integers/errors.sw @@ -2,6 +2,6 @@ library; /// Error log for when unexpected behavior has occurred. pub enum Error { - /// Emitted when division by zero has occured. + /// Emitted when division by zero has occurred. ZeroDivisor: (), }