Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
steps:
- name: Pull source
uses: actions/checkout@v2
- run: sudo apt -y install pkg-config libssl-dev liblzma-dev
- name: Run cargo test
run: cargo test
env:
Expand All @@ -30,6 +31,7 @@ jobs:
steps:
- name: Pull source
uses: actions/checkout@v2
- run: sudo apt -y install pkg-config libssl-dev liblzma-dev
- name: Run cargo clippy
run: cargo clippy
env:
Expand Down
4 changes: 2 additions & 2 deletions src/elf/detect.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::io::BufReader;
use std::io::Read;
use std::path::Path;

Expand All @@ -15,8 +16,7 @@ pub type Result<T> = std::result::Result<T, Error>;

/// Is the binary at `path` an ELF?
pub fn is_elf(path: &Path) -> Result<bool> {
Ok(File::open(path)
.context(OpenSnafu)?
Ok(BufReader::new(File::open(path).context(OpenSnafu)?)
.bytes()
.take(4)
.collect::<std::io::Result<Vec<u8>>>()
Expand Down