Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyProgrammist committed Dec 20, 2024
1 parent feaa181 commit 8d178bd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions near-sdk-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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<String>
/// }
///
///
/// // Define the default, which automatically initializes the contract
/// impl Default for Contract {
/// fn default() -> Self {
Expand Down
2 changes: 1 addition & 1 deletion near-sdk/src/environment/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/near/near-sdk-rs/tree/master/examples/factory-contract/low-level/src/lib.rs> and <https://github.com/near/near-sdk-rs/blob/master/examples/cross-contract-calls/low-level/src/lib.rs>
/// Example usages of this low-level api are <https://github.com/near/near-sdk-rs/tree/master/examples/factory-contract/low-level/src/lib.rs> and <https://github.com/near/near-sdk-rs/blob/master/examples/cross-contract-calls/low-level/src/lib.rs>
///
pub fn promise_create(
account_id: AccountId,
Expand Down
2 changes: 1 addition & 1 deletion near-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
//! ```bash
//! cargo install --locked cargo-near
//! ```
//!
//!
//! Build your contract for the NEAR blockchain:
//!
//! ```bash
Expand Down
2 changes: 1 addition & 1 deletion near-sdk/src/types/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/// }
/// }
/// }
///
///
/// #[near]
/// impl Contract {
/// // if the Error does not implement FunctionError, the following will not compile with #[handle_result]
Expand Down
2 changes: 1 addition & 1 deletion near-sdk/src/utils/storage_key_impl.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Converts Self into a [`Vec<u8>`] 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<u8>`] bytes which are used as a storage key.
Expand Down

0 comments on commit 8d178bd

Please sign in to comment.