···7272 self.push(byte);
7373 }
74747575- /// Pushes the etf of an empty list.
7676- /// - If you need to build lists with a number of items that is not known in
7777- /// advance you can use `start_list` and `end_list`.
7878- ///
7979- /// https://www.erlang.org/doc/apps/erts/erl_ext_dist.html#nil_ext
8080- pub fn empty_list(&mut self) {
8181- self.nil()
8282- }
8383-8475 /// Start building a list with a number of item that is not known in
8576 /// advance.
8677 ///
···10899 }
109100110101 pub fn end_list(&mut self, list: List, items: u32) {
111111- self.nil();
102102+ self.empty_list();
112103 self.bytes[list.size_index..list.size_index + 4].copy_from_slice(&items.to_be_bytes());
113104 list.consume();
114105 }
···174165 }
175166176167 /// https://www.erlang.org/doc/apps/erts/erl_ext_dist.html#nil_ext
177177- fn nil(&mut self) {
168168+ pub fn empty_list(&mut self) {
178169 self.push(106);
179170 }
180171···329320 #[test]
330321 fn empty_list() {
331322 let mut etf = Etf::new();
332332- etf.nil();
323323+ etf.empty_list();
333324 assert_eq!(etf.into_vec(), [131, 106]);
334325 }
335326