Skip to content

Commit

Permalink
Simplify match
Browse files Browse the repository at this point in the history
This takes advantage of the default match bindings in Rust 2018.
  • Loading branch information
mgeisler committed Mar 30, 2020
1 parent fbe7de7 commit c19ad67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/markdown_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn find_toml_blocks(text: &str) -> Vec<CodeBlock<'_>> {
let mut code_blocks = Vec::new();
for (event, range) in parser.into_offset_iter() {
match event {
Event::Start(Tag::CodeBlock(Fenced(ref lang))) if is_toml_block(lang) => {
Event::Start(Tag::CodeBlock(Fenced(lang))) if is_toml_block(&lang) => {
let line_count = text[..range.start].lines().count();
let code_block = &text[range];
let start = 1 + code_block.find('\n').unwrap_or(0);
Expand Down

0 comments on commit c19ad67

Please sign in to comment.