feat: ignore empty lines
This commit is contained in:
parent
23f3f0b070
commit
9d55dd5fe8
1 changed files with 8 additions and 2 deletions
10
src/main.rs
10
src/main.rs
|
@ -9,8 +9,14 @@ fn main() -> Result<()> {
|
|||
|
||||
let mut memory: HashMap<String, i64> = HashMap::new();
|
||||
|
||||
for instruction in buffer.lines() {
|
||||
let ops: Vec<String> = instruction?
|
||||
for line in buffer.lines() {
|
||||
let line = line?;
|
||||
|
||||
if line.clone().trim().is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let ops: Vec<String> = line.trim()
|
||||
.split_whitespace()
|
||||
.map(String::from)
|
||||
.collect();
|
||||
|
|
Loading…
Reference in a new issue