diff --git a/lib/std/array_list.zig b/lib/std/array_list.zig index 23a9573a3fa4a05aadd61516ea0f45eeb2212903..6e9a3d528660db3d2c202ef84146f46db32ee444 100644 --- a/lib/std/array_list.zig +++ b/lib/std/array_list.zig @@ -544,6 +544,11 @@ pub fn AlignedManaged(comptime T: type, comptime alignment: ?mem.Alignment) type return self.allocatedSlice()[self.items.len..]; } + /// Deprecated + pub fn getLast(self: Self) T { + return self.items[self.items.len - 1]; + } + /// Deprecated in favor of `last` pub const getLastOrNull = last; @@ -1399,6 +1404,14 @@ pub fn Aligned(comptime T: type, comptime alignment: ?mem.Alignment) type { return self.allocatedSlice()[self.items.len..]; } + /// Deprecated + pub fn getLast(self: Self) T { + return self.items[self.items.len - 1]; + } + + /// Deprecated in favor of `last` + pub const getLastOrNull = last; + /// Returns the last element from the list, or `null` if the list is /// empty. pub fn last(self: Self) ?T {