Skip to content

Commit

Permalink
Use first method instead of index based access
Browse files Browse the repository at this point in the history
  • Loading branch information
kyu08 authored and Sigmanificient committed Apr 3, 2024
1 parent ad18d56 commit 43cd840
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/model/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ fn get_line_type(line: &str) -> LineType {
return LineType::DefineStart;
}

match words[0] {
DEFINE_BLOCK_START => LineType::DefineStart,
DEFINE_BLOCK_END => LineType::DefineEnd,
_ => LineType::Normal,
match words.first() {
Some(&w) => match w {
DEFINE_BLOCK_START => LineType::DefineStart,
DEFINE_BLOCK_END => LineType::DefineEnd,
_ => LineType::Normal,
},
None => LineType::Normal,
}
}

Expand Down

0 comments on commit 43cd840

Please sign in to comment.