Skip to content

Commit

Permalink
comment: resolves #1313 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Feb 25, 2025
1 parent 6ad67a5 commit 1582199
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 48 deletions.
37 changes: 0 additions & 37 deletions near-sdk-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,43 +374,6 @@ pub fn ext_contract(attr: TokenStream, item: TokenStream) -> TokenStream {
}
}

// The below attributes a marker-attributes and therefore they are no-op.

/// `callback` is a marker attribute it does not generate code by itself.
#[proc_macro_attribute]
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
pub fn callback(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}

/// `callback_args_vec` is a marker attribute it does not generate code by itself.
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
#[proc_macro_attribute]
pub fn callback_vec(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}

/// `serializer` is a marker attribute it does not generate code by itself.
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
#[proc_macro_attribute]
pub fn serializer(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}

/// `result_serializer` is a marker attribute it does not generate code by itself.
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
#[proc_macro_attribute]
pub fn result_serializer(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}

/// `init` is a marker attribute it does not generate code by itself.
#[deprecated(since = "4.0.0", note = "Case is handled internally by macro, no need to import")]
#[proc_macro_attribute]
pub fn init(_attr: TokenStream, item: TokenStream) -> TokenStream {
item
}

#[cfg(feature = "abi")]
#[derive(darling::FromDeriveInput, Debug)]
#[darling(attributes(abi), forward_attrs(serde, borsh_skip, schemars, validate))]
Expand Down
27 changes: 16 additions & 11 deletions near-sdk/src/near_annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
//! This is not a real module; here we document the attributes that [`#[near]`](crate::near)
//! and [`#[near_bindgen]`](crate::near_bindgen) macro use.
//!
//! `near_bindgen` and `near_sdk` shares almost the same attributes:
//! * init
//! * payable
//! * private
//! * handle_result
//! * event_json
//! * contract_metadata
//! * serializer
//! `near_bindgen` and `near_sdk` share most of the attributes:
//! * `init`
//! * `payable`
//! * `private`
//! * `handle_result`
//! * `callback_unwrap`
//! * `event_json`
//! * `contract_metadata`
//! * `serializer`
//! * `result_serializer`
//!
//! These attributes are only part of the `near` macro.
//! * serializers
//! * contract_state
//! Following attributes are only part of the `near` macro:
//! * `serializers`
//! * `contract_state`
/// See [`near_sdk::near #[init]`](crate::near#init-annotates-methods-of-a-type-in-its-impl-block)
pub fn init() {}
Expand All @@ -31,6 +33,9 @@ pub fn result_serializer() {}
/// See [`near_sdk::near #[handle_result]`](crate::near#handle_result-annotates-methods-of-a-type-in-its-impl-block)
pub fn handle_result() {}

/// See [`near_sdk::near #[callback_unwrap]`](crate::near#callback_unwrap-annotates-function-arguments)
pub fn callback_unwrap() {}

/// See [`near_sdk::near #[near(event_json(...))]`](crate::near#nearevent_json-annotates-enums)
pub fn event_json() {}

Expand Down

0 comments on commit 1582199

Please sign in to comment.