Skip to content

Commit

Permalink
Fix a dead code warning
Browse files Browse the repository at this point in the history
  • Loading branch information
honzasp committed Jul 16, 2024
1 parent e731a23 commit 8688767
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/host_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct Line {
enum LineContent {
Comment,
Entry(Box<Entry>),
Error(&'static str),
Error,
}

/// An entry in [`File`].
Expand Down Expand Up @@ -138,7 +138,7 @@ impl File {
pub fn entries(&self) -> impl Iterator<Item = &Entry> {
self.lines.iter().filter_map(|line| match &line.content {
LineContent::Entry(entry) => Some(entry as &Entry),
LineContent::Comment | LineContent::Error(_) => None,
LineContent::Comment | LineContent::Error => None,
})
}

Expand Down Expand Up @@ -401,7 +401,7 @@ fn decode_file(data: Bytes) -> File {
let bytes = data.slice_ref(bytes);
let content = match decode_line(&bytes, line_i) {
Ok(content) => content,
Err(msg) => LineContent::Error(msg),
Err(_msg) => LineContent::Error,
};
Line { bytes, content }
})
Expand Down

0 comments on commit 8688767

Please sign in to comment.