diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 23:18:56 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 23:18:56 +0000 |
| commit | 7f7be8a8202b9ccea19ae379665e3a34a81b6797 (patch) | |
| tree | cca7fdae365a7240a883cc9ebf0e5090c4311320 /examples/data_structures/stack.zc | |
| parent | 70144b6829c3ca8ff8b46e40b358cc711db85efb (diff) | |
Improved examples in 'examples/'
Diffstat (limited to 'examples/data_structures/stack.zc')
| -rw-r--r-- | examples/data_structures/stack.zc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/data_structures/stack.zc b/examples/data_structures/stack.zc index 4a8593a..ea6a20a 100644 --- a/examples/data_structures/stack.zc +++ b/examples/data_structures/stack.zc @@ -1,11 +1,11 @@ import "std.zc" -struct Stack<T> { +struct MyStack<T> { data: Vec<T>; } -impl Stack<T> { +impl MyStack<T> { fn new() -> Self { return Self { data: Vec<T>::new() }; } @@ -43,7 +43,7 @@ impl Stack<T> { fn main() { "[Integer Stack]"; - let int_stack = Stack<int>::new(); + let int_stack = MyStack<int>::new(); defer int_stack.free(); "Pushing: 10, 20, 30"; @@ -64,7 +64,7 @@ fn main() { ""; "[String Stack]"; - let str_stack = Stack<String>::new(); + let str_stack = MyStack<String>::new(); defer str_stack.free(); str_stack.push(String::new("First")); |
