Explicitly declare decl_storage! getters as functions (#3870)

* parse decl_storage getters with fn keyword

* test for get in decl_storage

* update all decl_storage! getters

* bump version

* adjust missed doc line
This commit is contained in:
Robert Habermeier
2019-10-22 03:53:58 -04:00
committed by Bastian Köcher
parent 1111d79ac1
commit 5d5e71028e
36 changed files with 190 additions and 175 deletions
+3 -3
View File
@@ -33,7 +33,7 @@ use proc_macro::TokenStream;
/// ```nocompile
/// decl_storage! {
/// trait Store for Module<T: Trait> as Example {
/// Foo get(foo) config(): u32=12;
/// Foo get(fn foo) config(): u32=12;
/// Bar: map u32 => u32;
/// pub Zed build(|config| vec![(0, 0)]): linked_map u32 => u32;
/// }
@@ -120,11 +120,11 @@ use proc_macro::TokenStream;
///
/// Basic storage can be extended as such:
///
/// `#vis #name get(#getter) config(#field_name) build(#closure): #type = #default;`
/// `#vis #name get(fn #getter) config(#field_name) build(#closure): #type = #default;`
///
/// * `#vis`: Set the visibility of the structure. `pub` or nothing.
/// * `#name`: Name of the storage item, used as a prefix in storage.
/// * [optional] `get(#getter)`: Implements the function #getter to `Module`.
/// * [optional] `get(fn #getter)`: Implements the function #getter to `Module`.
/// * [optional] `config(#field_name)`: `field_name` is optional if get is set.
/// Will include the item in `GenesisConfig`.
/// * [optional] `build(#closure)`: Closure called with storage overlays.