Fix compiler warnings

pull/1/head
trivernis 5 years ago
parent 90777b8ae6
commit 6c6de07631

@ -1,4 +1,3 @@
use ledstrip_vm::asm_tokens;
use ledstrip_vm::asm_tokens::{
AddToken, ClearToken, CmdToken, CopyToken, DivToken, ExitToken, GotoToken, JeToken, JgToken,
JlToken, LabelToken, LoadToken, LshToken, ModToken, MulToken, PauseToken, RshToken, SetToken,
@ -7,7 +6,7 @@ use ledstrip_vm::asm_tokens::{
use ledstrip_vm::registers::get_register_by_name;
use std::fs::{read_to_string, File};
use std::io;
use std::io::{BufRead, BufReader, BufWriter, Read, Write};
use std::io::{BufWriter, Write};
use std::num::ParseIntError;
use structopt::StructOpt;
@ -60,9 +59,9 @@ fn get_token(line: &str) -> Option<Box<dyn Token>> {
let mut instr_parts = line.split_whitespace();
match instr_parts.next()? {
"exit" => Some(Box::new(ExitToken {
"exit" => some_box!(ExitToken {
register: get_register_by_name(instr_parts.next()?)?,
})),
}),
"set" => some_box!(SetToken {
value: parse_value(instr_parts.next()?).expect(&format!(
"Failed to parse the hex value into a u8: {}.",

@ -22,7 +22,7 @@ pub fn get_register_by_name(name: &str) -> Option<u8> {
("rgl", RGL),
]
.iter()
.find(|(reg, bc)| *reg == name);
.find(|(reg, _)| *reg == name);
if let Some(item) = item {
Some((*item).1)

Loading…
Cancel
Save