From 756cad213f702e698515f84d0e55b34af3e4b8c0 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 17 Mar 2023 11:06:12 +0000 Subject: [PATCH] Add comments --- codegen/src/api/storage.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index 987593bb45..26f5b560b0 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -88,6 +88,7 @@ fn generate_storage_entry_fns( StorageEntryType::Map { key, .. } => { let key_ty = type_gen.resolve_type(key.id()); match key_ty.type_def() { + // An N-map; return each of the keys separately. TypeDef::Tuple(tuple) => { let fields = tuple .fields() @@ -111,6 +112,7 @@ fn generate_storage_entry_fns( (fields, key_impl) } + // A map with a single key; return the single key. _ => { let ty_path = type_gen.resolve_type_path(key.id()); let fields = vec![(format_ident!("_0"), ty_path)];