summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2026-03-04 01:08:48 +0100
committerThomas Voss <mail@thomasvoss.com> 2026-03-04 01:08:48 +0100
commit6473caf1faf7b1099fa63fcfcf5e688b59e05199 (patch)
tree96289ee56f136701a3b031ff981cd688271f3ca7
parentdb7f0b2c4160ea0ad3a8a1795e17e80ae33385db (diff)
Use iter::once() instead of vec![e]
-rw-r--r--oryxc/src/compiler.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/oryxc/src/compiler.rs b/oryxc/src/compiler.rs
index c106d49..36c6438 100644
--- a/oryxc/src/compiler.rs
+++ b/oryxc/src/compiler.rs
@@ -3,7 +3,10 @@ use std::io::{
self,
Write,
};
-use std::iter::IntoIterator;
+use std::iter::{
+ self,
+ IntoIterator,
+};
use std::mem::MaybeUninit;
use std::sync::Arc;
use std::sync::atomic::{
@@ -160,7 +163,7 @@ fn worker_loop(
let tokens = match lexer::tokenize(buffer.as_ref()) {
Ok(xs) => xs,
Err(e) => {
- emit_errors(state.clone(), file, vec![e]);
+ emit_errors(state.clone(), file, iter::once(e));
process::exit(1);
},
};