@@ -36,10 +36,16 @@ impl<'gc> Table<'gc> {
3636
3737 pub fn from_parts (
3838 mc : & Mutation < ' gc > ,
39- entries : RawTable < ' gc > ,
39+ raw_table : RawTable < ' gc > ,
4040 metatable : Option < Table < ' gc > > ,
4141 ) -> Table < ' gc > {
42- Self ( Gc :: new ( mc, RefLock :: new ( TableState { entries, metatable } ) ) )
42+ Self ( Gc :: new (
43+ mc,
44+ RefLock :: new ( TableState {
45+ raw_table,
46+ metatable,
47+ } ) ,
48+ ) )
4349 }
4450
4551 pub fn from_inner ( inner : Gc < ' gc , TableInner < ' gc > > ) -> Self {
@@ -64,7 +70,7 @@ impl<'gc> Table<'gc> {
6470 }
6571
6672 pub fn get_value ( self , key : Value < ' gc > ) -> Value < ' gc > {
67- self . 0 . borrow ( ) . entries . get ( key)
73+ self . 0 . borrow ( ) . raw_table . get ( key)
6874 }
6975
7076 pub fn set_value (
@@ -73,7 +79,7 @@ impl<'gc> Table<'gc> {
7379 key : Value < ' gc > ,
7480 value : Value < ' gc > ,
7581 ) -> Result < Value < ' gc > , InvalidTableKey > {
76- self . 0 . borrow_mut ( & mc) . entries . set ( key, value)
82+ self . 0 . borrow_mut ( & mc) . raw_table . set ( key, value)
7783 }
7884
7985 /// Returns a 'border' for this table.
@@ -84,7 +90,7 @@ impl<'gc> Table<'gc> {
8490 /// If a table has exactly one border, it is called a 'sequence', and this border is the table's
8591 /// length.
8692 pub fn length ( self ) -> i64 {
87- self . 0 . borrow ( ) . entries . length ( )
93+ self . 0 . borrow ( ) . raw_table . length ( )
8894 }
8995
9096 /// Returns the next value after this key in the table order.
@@ -98,7 +104,7 @@ impl<'gc> Table<'gc> {
98104 /// in the table, it will return the next pair in iteration order. If given a key that is not
99105 /// present in the table, the behavior is unspecified.
100106 pub fn next ( self , key : Value < ' gc > ) -> NextValue < ' gc > {
101- self . 0 . borrow ( ) . entries . next ( key)
107+ self . 0 . borrow ( ) . raw_table . next ( key)
102108 }
103109
104110 /// Iterate over the key-value pairs of the table.
@@ -163,6 +169,6 @@ impl<'gc> IntoIterator for Table<'gc> {
163169#[ derive( Debug , Collect ) ]
164170#[ collect( no_drop) ]
165171pub struct TableState < ' gc > {
166- pub entries : RawTable < ' gc > ,
172+ pub raw_table : RawTable < ' gc > ,
167173 pub metatable : Option < Table < ' gc > > ,
168174}
0 commit comments