rtl: add consts to List

This commit is contained in:
Loïc Grégoire
2026-07-22 17:00:13 -04:00
parent 5a30511866
commit 00ae1a21f2
+3 -3
View File
@@ -33,7 +33,7 @@ pub const List = struct {
} }
/// Return whether the list is empty. /// Return whether the list is empty.
pub fn is_empty(self: *List) bool { pub fn is_empty(self: *const List) bool {
return self.head.next == &self.head; return self.head.next == &self.head;
} }
@@ -63,12 +63,12 @@ pub const List = struct {
return self.head.prev; return self.head.prev;
} }
pub fn iterator(self: *List) Iterator { pub fn iterator(self: *const List) Iterator {
return .{ .head = &self.head, .current = self.head.next }; return .{ .head = &self.head, .current = self.head.next };
} }
pub const Iterator = struct { pub const Iterator = struct {
head: *Entry, head: *const Entry,
current: *Entry, current: *Entry,
pub fn next(self: *Iterator) bool { pub fn next(self: *Iterator) bool {