Skip to content

Commit 9d2ca8d

Browse files
authored
docs(07_mapping): supplement KeyType (#867)
Supplement KeyType
1 parent af97c81 commit 9d2ca8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

07_Mapping/Mapping.sol

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ contract Mapping {
44
mapping(uint => address) public idToAddress; // id映射到地址
55
mapping(address => address) public swapPair; // 币对的映射,地址到地址
66

7-
// 规则1. _KeyType不能是自定义的 下面这个例子会报错
7+
// 规则1. _KeyType 不能是自定义的, 下面这个例子会报错
8+
// _KeyType 可以是 内置值类型,string, bytes, 合约,枚举类型
89
// 我们定义一个结构体 Struct
910
// struct Student{
1011
// uint256 id;

0 commit comments

Comments
 (0)