diff --git a/near-sdk/src/lib.rs b/near-sdk/src/lib.rs index 7738e023f..095cdacad 100644 --- a/near-sdk/src/lib.rs +++ b/near-sdk/src/lib.rs @@ -112,9 +112,6 @@ extern crate quickcheck; /// The attribute prepares a struct/enum to be a contract state. /// **The attribute specific to the [near] macro only.** /// -/// This attribute 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. -/// /// ### Basic example /// ```rust /// use near_sdk::near; @@ -123,11 +120,6 @@ extern crate quickcheck; /// pub struct Contract { /// data: i8, /// } -/// -/// #[near] -/// impl Contract { -/// pub fn some_function(&self) {} -/// } /// ``` /// /// ## `#[near(serializers=[...])` (annotates structs/enums) @@ -195,7 +187,7 @@ extern crate quickcheck; /// /// #[near] /// impl Contract { -/// pub fn some_function(&self, #[serializer(borsh)] a: String, #[serializer(borsh)] b: String) {} +/// pub fn borsh_arguments(&self, #[serializer(borsh)] a: String, #[serializer(borsh)] b: String) {} /// } /// ``` /// @@ -300,36 +292,12 @@ extern crate quickcheck; /// #[near] /// impl MyContract { /// #[result_serializer(borsh)] -/// pub fn borsh_parameters(&self) -> String { +/// pub fn borsh_return_value(&self) -> String { /// "hello_world".to_string() /// } /// } /// ``` /// -/// `#[near]` will handle serializing and setting the return value of the -/// function execution based on what type is returned by the function. By default, this will be -/// done through `serde` serialized as JSON, but this can be overridden using -/// `#[result_serializer(borsh)]`: -/// -/// ### Basic example -/// -/// ```rust -/// use near_sdk::near; -/// -/// # #[near(contract_state)] -/// # struct MyContract { -/// # pub name: String, -/// # } -/// -/// #[near] -/// impl MyContract { -/// #[result_serializer(borsh)] -/// pub fn borsh_parameters(&self) -> String { -/// self.name.clone() -/// } -/// } -/// ``` -/// /// ## `#[handle_result]` (annotates methods of a type in its `impl` block) /// /// Have `#[handle_result]` to Support Result types regardless of how they're referred to