Repository: paritytech/substrate
File: frame/support/procedural/src/pallet/parse/storage.rs (Rust)

Code before:
			} else {
				mandatory_generics = &["Hasher1", "Key1", "Hasher2", "Key2", "Value"];
				optional_generics = &["QueryKind", "OnEmpty", "MaxValues"];
			}

			check_generics(
				&parsed,
				mandatory_generics,
				optional_generics,
				"StorageDoubleMap",
				args_span,
			)?;

			StorageGenerics::DoubleMap {
				hasher1: parsed
					.remove("Hasher1")
					.map(|binding| binding.ty)
					.unwrap_or(syn::Type::Verbatim(quote::quote! { Blake2_128Concat })),
				key1: parsed
					.remove("Key1")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				hasher2: parsed
					.remove("Hasher2")
					.map(|binding| binding.ty)
					.unwrap_or(syn::Type::Verbatim(quote::quote! { Blake2_128Concat })),
				key2: parsed
					.remove("Key2")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				value: parsed
					.remove("Value")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				query_kind: parsed.remove("QueryKind").map(|binding| binding.ty),
				on_empty: parsed.remove("OnEmpty").map(|binding| binding.ty),
				max_values: parsed.remove("MaxValues").map(|binding| binding.ty),
			}
		},
		StorageKind::NMap => {
			check_generics(
				&parsed,
				&["Key", "Value"],
				&["QueryKind", "OnEmpty", "MaxValues"],
				"StorageNMap",
				args_span,
			)?;

			StorageGenerics::NMap {
				keygen: parsed
					.remove("Key")

Review comment (suggestion):
 same here:

```suggestion
					.unwrap_or(syn::parse_quote!(Blake2_128Concat)),
```

Code after:
					.remove("Hasher1")
					.map(|binding| binding.ty)
					.unwrap_or(syn::parse_quote!(Blake2_128Concat)),
				key1: parsed
					.remove("Key1")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				hasher2: parsed
					.remove("Hasher2")
					.map(|binding| binding.ty)
					.unwrap_or(syn::parse_quote!(Blake2_128Concat)),
				key2: parsed
					.remove("Key2")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				value: parsed
					.remove("Value")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				query_kind: parsed.remove("QueryKind").map(|binding| binding.ty),
				on_empty: parsed.remove("OnEmpty").map(|binding| binding.ty),
				max_values: parsed.remove("MaxValues").map(|binding| binding.ty),
			}
		},
		StorageKind::NMap => {
			check_generics(
				&parsed,
				&["Key", "Value"],
				&["QueryKind", "OnEmpty", "MaxValues"],
				"StorageNMap",
				args_span,
			)?;

			StorageGenerics::NMap {
				keygen: parsed
					.remove("Key")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				value: parsed
					.remove("Value")
					.map(|binding| binding.ty)
					.expect("checked above as mandatory generic"),
				query_kind: parsed.remove("QueryKind").map(|binding| binding.ty),
				on_empty: parsed.remove("OnEmpty").map(|binding| binding.ty),
				max_values: parsed.remove("MaxValues").map(|binding| binding.ty),
			}
		},
	};

	let metadata = generics.metadata()?;
	let query_kind = generics.query_kind();