authorgravatar for MatthiasPortzel@gmail.comMatthias Portzel <MatthiasPortzel@gmail.com> 2026-08-23 17:14:19-05:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-08-25 22:14:36+02:00
log18e38104ce60a02f27b565097cff66c3429aa8d4
tree4ac8bc3542597b2cd47732e072f92cf8a4d5b041
parent1919919a37844d20395f20075cbd5c1ebbc11fab

Re-add deprecated getLast and getLastOrNull


1 files changed, 13 insertions(+), 0 deletions(-)

lib/std/array_list.zig+13
......@@ -544,6 +544,11 @@ pub fn AlignedManaged(comptime T: type, comptime alignment: ?mem.Alignment) type
544544 return self.allocatedSlice()[self.items.len..];
545545 }
546546
547 /// Deprecated
548 pub fn getLast(self: Self) T {
549 return self.items[self.items.len - 1];
550 }
551
547552 /// Deprecated in favor of `last`
548553 pub const getLastOrNull = last;
549554
......@@ -1399,6 +1404,14 @@ pub fn Aligned(comptime T: type, comptime alignment: ?mem.Alignment) type {
13991404 return self.allocatedSlice()[self.items.len..];
14001405 }
14011406
1407 /// Deprecated
1408 pub fn getLast(self: Self) T {
1409 return self.items[self.items.len - 1];
1410 }
1411
1412 /// Deprecated in favor of `last`
1413 pub const getLastOrNull = last;
1414
14021415 /// Returns the last element from the list, or `null` if the list is
14031416 /// empty.
14041417 pub fn last(self: Self) ?T {