Compare commits

..

2 Commits

Author SHA1 Message Date
8f8f8ffe80 Update README.md 2025-04-07 17:50:32 +02:00
6ed7838a53 [Compiler-Rust]: Vec.get(0) -> Vec.first() 2024-01-02 17:22:36 +01:00
2 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
**Moved to [Codeberg](https://codeberg.org/0x4261756D/kurz)**
# kurz # kurz
Queue based language Queue based language

View File

@ -954,7 +954,7 @@ fn interpret_program(operations: &Vec<Operation>, queue: &mut Vec<String>, funct
} }
Operation::Dup(_, _) => Operation::Dup(_, _) =>
{ {
let val = queue.get(0).unwrap(); let val = queue.first().unwrap();
queue.push(val.clone()); queue.push(val.clone());
} }
Operation::Swap(_, _) => Operation::Swap(_, _) =>
@ -1249,7 +1249,7 @@ fn get_return_type(operations: &Vec<Operation>, ins: &[Datatype], functions: &Ve
} }
Operation::Dup(line, col) => Operation::Dup(line, col) =>
{ {
if let Some(typ) = type_queue.get(0) if let Some(typ) = type_queue.first()
{ {
type_queue.push(*typ); type_queue.push(*typ);
} }