mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 16:41:01 -05:00
refactor: Delegate to rust for IO
This commit is contained in:
parent
2ae1a0bca6
commit
a8629916b4
1 changed files with 1 additions and 5 deletions
|
@ -1,6 +1,3 @@
|
|||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
use bstr::ByteSlice;
|
||||
|
||||
use crate::report;
|
||||
|
@ -122,8 +119,7 @@ impl<'d, 'p> Checks<'d, 'p> {
|
|||
return Ok(typos_found);
|
||||
}
|
||||
|
||||
let mut buffer = Vec::new();
|
||||
File::open(path)?.read_to_end(&mut buffer)?;
|
||||
let buffer = std::fs::read(path)?;
|
||||
if !explicit && !self.binary && buffer.find_byte(b'\0').is_some() {
|
||||
let msg = report::BinaryFile {
|
||||
path,
|
||||
|
|
Loading…
Reference in a new issue