From 40fb99ef2d27f9f25bfb82bc92067b7a08a2636d Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:44:56 +0800 Subject: [PATCH] docs: fix typos --- GRAVEYARD.md | 2 +- docker/ci/github/Dockerfile | 2 +- language/documentation/book/src/standard-library.md | 2 +- .../book/translations/move-book-zh/src/standard-library.md | 2 +- language/documentation/coding_guidelines.md | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/GRAVEYARD.md b/GRAVEYARD.md index d947d6e591..2dc30443e5 100644 --- a/GRAVEYARD.md +++ b/GRAVEYARD.md @@ -30,7 +30,7 @@ Bring back support for native structs in the VM. They can use a simple uniform r ## Signer relaxation for `move_to` ### Decision -Tables and framework-specific workarounds like `ResourceAccount` make this unneccessary. +Tables and framework-specific workarounds like `ResourceAccount` make this unnecessary. ### Rationale In some usage scenarios of Move, it does not make sense to only allow move_to(s, x) with s a signer. For instance, when Move is running on the EVM, storage is not owned and paid for by the account owner, but by the contract caller, which manages the accounts on behalf of owners. In general, the signer requirement allows one to only create new resources at addresses for which the transaction has a signer, which disables the capability to manage resource collections on behalf of others. diff --git a/docker/ci/github/Dockerfile b/docker/ci/github/Dockerfile index 323fe229ef..26a9836a31 100644 --- a/docker/ci/github/Dockerfile +++ b/docker/ci/github/Dockerfile @@ -42,7 +42,7 @@ RUN [ -x "$(set -x; command -v rustup)" ] \ && [ -x "$(set -x; command -v npm)" ] # should be a no-op -# sccache builds fine, but is not executable ??? in alpine, ends up being recompiled. Wierd. +# sccache builds fine, but is not executable ??? in alpine, ends up being recompiled. Weird. RUN /move/scripts/dev_setup.sh -t -y -d -b -p FROM setup_ci as build_environment diff --git a/language/documentation/book/src/standard-library.md b/language/documentation/book/src/standard-library.md index 7dcd8f2251..045c99aa47 100644 --- a/language/documentation/book/src/standard-library.md +++ b/language/documentation/book/src/standard-library.md @@ -347,7 +347,7 @@ The system is in a state where the performed operation is not allowed. ``` --------------------------------------------------------------------------- -A specific account address was required to perform an operation, but a different address from what was expected was encounterd. +A specific account address was required to perform an operation, but a different address from what was expected was encountered. ```move const REQUIRES_ADDRESS: u8 = 2; diff --git a/language/documentation/book/translations/move-book-zh/src/standard-library.md b/language/documentation/book/translations/move-book-zh/src/standard-library.md index 85c8d9f433..534df4f1b5 100644 --- a/language/documentation/book/translations/move-book-zh/src/standard-library.md +++ b/language/documentation/book/translations/move-book-zh/src/standard-library.md @@ -447,7 +447,7 @@ The system is in a state where the performed operation is not allowed. ``` --------------------------------------------------------------------------- -A specific account address was required to perform an operation, but a different address from what was expected was encounterd. +A specific account address was required to perform an operation, but a different address from what was expected was encountered. 执行操作需要一个特定的帐户地址,但遇到的地址与预期的不同。 diff --git a/language/documentation/coding_guidelines.md b/language/documentation/coding_guidelines.md index 9df7fbd49c..4dad35250b 100644 --- a/language/documentation/coding_guidelines.md +++ b/language/documentation/coding_guidelines.md @@ -207,11 +207,11 @@ impl Foo { As every integer operation (`+`, `-`, `/`, `*`, etc.) implies edge-cases (e.g. overflows `u64::MAX + 1`, underflows `0u64 -1`, division by zero, etc.), we use checked arithmetic instead of directly using math symbols. -It forces us to think of edge-cases, and handle them explicitely. +It forces us to think of edge-cases, and handle them explicitly. This is a brief and simplified mini guide of the different functions that exist to handle integer arithmetic: * [checked_](https://doc.rust-lang.org/std/primitive.u32.html#method.checked_add): use this function if you want to handle overflows and underflows as a special edge-case. It returns `None` if an underflow or overflow has happened, and `Some(operation_result)` otherwise. -* [overflowing_](https://doc.rust-lang.org/std/primitive.u32.html#method.overflowing_add): use this function if you want the result of an overflow to potentially wrap around (e.g. `u64::MAX.overflow_add(10) == (9, true)`). It returns the underflowed or overflowed result as well as a flag indicating if an overflow has occured or not. +* [overflowing_](https://doc.rust-lang.org/std/primitive.u32.html#method.overflowing_add): use this function if you want the result of an overflow to potentially wrap around (e.g. `u64::MAX.overflow_add(10) == (9, true)`). It returns the underflowed or overflowed result as well as a flag indicating if an overflow has occurred or not. * [wrapping_](https://doc.rust-lang.org/std/primitive.u32.html#method.wrapping_add): this is similar to overflowing operations, except that it returns the result directly. Use this function if you are sure that you want to handle underflows and overflows by wrapping around. * [saturating_](https://doc.rust-lang.org/std/primitive.u32.html#method.saturating_add): if an overflow occurs, the result is kept within the boundary of the type (e.g. `u64::MAX.saturating_add(1) == u64::MAX`). @@ -306,7 +306,7 @@ For the sake of example, we'll consider you are defining a test-only helper func 3. (optional) Use `cfg_attr` to make test-only trait derivations conditional: ```rust #[cfg_attr(any(test, feature = "testing"), derive(FooTrait))] - #[derive(Debug, Display, ...)] // inconditional derivations + #[derive(Debug, Display, ...)] // unconditional derivations struct Foo { ... } ``` 4. (optional) Set up feature transitivity for crates that call crates that have test-only members. Let's say it's the case of `bar_crate`, which, through its test helpers, calls into `foo_crate` to use your test-only `foo`. Here's how you would set up `bar_crate/Cargo.toml`: