Feat suppert procedural (#7913)

* fix clippy replace clone with copy

* fix clippy warning pattern

* fix clippy warning replace into_iter with iter

* replace match with if let

* replace =0 with is_empty

* replace or with or_else

* replace vec! with Vec::new
This commit is contained in:
honeywest
2021-01-18 20:07:09 +08:00
committed by GitHub
parent ced107b355
commit 6ec0f64259
14 changed files with 67 additions and 73 deletions
@@ -200,7 +200,7 @@ pub fn maybe_print_pallet_upgrade(def: &super::DeclStorageDefExt) {
default_expr = to_cleaned_string(&default_expr),
)
})
.unwrap_or_else(|| String::new());
.unwrap_or_else(String::new);
let comma_query_kind = if line.is_option {
if line.default_value.is_some() {
@@ -214,7 +214,7 @@ pub fn maybe_print_pallet_upgrade(def: &super::DeclStorageDefExt) {
let comma_default_value_getter_name = line.default_value.as_ref()
.map(|_| format!(", DefaultFor{}", line.name))
.unwrap_or_else(|| String::new());
.unwrap_or_else(String::new);
let typ = match &line.storage_type {
StorageLineTypeDef::Map(map) => {