mirror of
https://github.com/Noratrieb/m8db.git
synced 2026-01-14 15:25:06 +01:00
clippy lints
This commit is contained in:
parent
3f159f644d
commit
8a32cbf057
2 changed files with 4 additions and 4 deletions
|
|
@ -90,11 +90,11 @@ pub fn start(program_path: Option<String>) {
|
|||
}
|
||||
}
|
||||
|
||||
fn read_and_run<'a>(path: &str) {
|
||||
fn read_and_run(path: &str) {
|
||||
let path = Path::new(path);
|
||||
|
||||
match std::fs::read_to_string(path) {
|
||||
Ok(content) => match stmt::parse(&content, filename(&path)) {
|
||||
Ok(content) => match stmt::parse(&content, filename(path)) {
|
||||
Ok(stmts) => run(stmts),
|
||||
Err(why) => eprintln!("error while parsing: {}.", why),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -223,8 +223,8 @@ fn parse_line(line: &str) -> Result<IrStmt, String> {
|
|||
}
|
||||
"STOP" => IrStmt::Stop,
|
||||
stmt => {
|
||||
if stmt.starts_with('.') {
|
||||
IrStmt::Label(&stmt[1..])
|
||||
if let Some(stripped) = stmt.strip_prefix('.') {
|
||||
IrStmt::Label(stripped)
|
||||
} else if stmt.starts_with('#') {
|
||||
IrStmt::None
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue