mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
rtl: add consts to List
This commit is contained in:
+3
-3
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user