diff --git a/near-sdk-macros/src/lib.rs b/near-sdk-macros/src/lib.rs index c04c4979c..9cd7e4521 100644 --- a/near-sdk-macros/src/lib.rs +++ b/near-sdk-macros/src/lib.rs @@ -55,7 +55,7 @@ struct NearMacroArgs { /// pub name: String, /// } /// ``` -/// +/// /// This macro will generate code to load and deserialize state if the `self` parameter is included /// as well as saving it back to state if `&mut self` is used. /// @@ -84,16 +84,16 @@ struct NearMacroArgs { /// ... // } /// ``` -/// +/// /// # Usage for enum / struct -/// +/// /// If the macro is used with struct or enum, it will make the struct or enum serializable with either /// Borsh or Json depending on serializers passed. Use `#[near(serializers=[borsh])]` to make it serializable with Borsh. /// Or use `#[near(serializers=[json])]` to make it serializable with Json. By default, borsh is used. /// You can also specify both and none. BorshSchema or JsonSchema are always generated. /// /// If you want the struct to be a contract state, you can pass in the contract_state argument. -/// +/// /// ## Example /// ```ignore /// use near_sdk::near; @@ -474,7 +474,7 @@ fn process_impl_block( /// fn mult(&self, a: u64, b: u64) -> u128; /// fn sum(&self, a: u128, b: u128) -> u128; /// } -/// +/// /// #[near] /// impl Contract { /// pub fn multiply_by_five(&mut self, number: u64) -> Promise { @@ -483,9 +483,9 @@ fn process_impl_block( /// .mult(number, 5) /// } /// } -/// +/// /// ``` -/// +/// /// See more information about role of ext_contract in [NEAR documentation](https://docs.near.org/build/smart-contracts/anatomy/crosscontract) #[proc_macro_attribute] pub fn ext_contract(attr: TokenStream, item: TokenStream) -> TokenStream { @@ -815,23 +815,23 @@ pub fn derive_no_default(item: TokenStream) -> TokenStream { /// `BorshStorageKey` generates implementation for `BorshIntoStorageKey` trait. /// It allows the type to be passed as a unique prefix for persistent collections. -/// The type should also implement or derive `BorshSerialize` trait. -/// +/// The type should also implement or derive `BorshSerialize` trait. +/// /// More information about storage keys in [NEAR documentation](https://docs.near.org/build/smart-contracts/anatomy/storage) -/// ## Example +/// ## Example /// ```ignore /// #[derive(BorshSerialize, BorshDeserialize, BorshStorageKey)] /// #[borsh(crate = "near_sdk::borsh")] /// pub enum StorageKey { /// Messages, /// } -/// +/// /// // Define the contract structure /// #[near(contract_state)] /// pub struct Contract { /// messages: Vector /// } -/// +/// /// // Define the default, which automatically initializes the contract /// impl Default for Contract { /// fn default() -> Self { diff --git a/near-sdk/src/environment/env.rs b/near-sdk/src/environment/env.rs index 9d9c164da..2857c1f83 100644 --- a/near-sdk/src/environment/env.rs +++ b/near-sdk/src/environment/env.rs @@ -755,7 +755,7 @@ pub fn alt_bn128_pairing_check(value: &[u8]) -> bool { /// /// More info about promises in [NEAR documentation](https://docs.near.org/build/smart-contracts/anatomy/crosscontract#promises) /// More low-level info here: [`near_vm_runner::logic::VMLogic::promise_create`] -/// Example usages of this low-level api are and +/// Example usages of this low-level api are and /// pub fn promise_create( account_id: AccountId, diff --git a/near-sdk/src/lib.rs b/near-sdk/src/lib.rs index d167cc010..77ca7eead 100644 --- a/near-sdk/src/lib.rs +++ b/near-sdk/src/lib.rs @@ -59,7 +59,7 @@ //! ```bash //! cargo install --locked cargo-near //! ``` -//! +//! //! Build your contract for the NEAR blockchain: //! //! ```bash diff --git a/near-sdk/src/types/error.rs b/near-sdk/src/types/error.rs index b74019750..77c809143 100644 --- a/near-sdk/src/types/error.rs +++ b/near-sdk/src/types/error.rs @@ -20,7 +20,7 @@ /// } /// } /// } -/// +/// /// #[near] /// impl Contract { /// // if the Error does not implement FunctionError, the following will not compile with #[handle_result] diff --git a/near-sdk/src/utils/storage_key_impl.rs b/near-sdk/src/utils/storage_key_impl.rs index 7fabd8ff0..ff25b5ff0 100644 --- a/near-sdk/src/utils/storage_key_impl.rs +++ b/near-sdk/src/utils/storage_key_impl.rs @@ -1,7 +1,7 @@ /// Converts Self into a [`Vec`] that is used for a storage key through [`into_storage_key`]. /// /// [`into_storage_key`]: IntoStorageKey::into_storage_key -/// +/// /// More information about storage is in [NEAR documentation](https://docs.near.org/build/smart-contracts/anatomy/storage). pub trait IntoStorageKey { /// Consumes self and returns [`Vec`] bytes which are used as a storage key.