mirror of
https://github.com/crate-ci/typos.git
synced 2025-02-16 01:52:58 -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 bstr::ByteSlice;
|
||||||
|
|
||||||
use crate::report;
|
use crate::report;
|
||||||
|
@ -122,8 +119,7 @@ impl<'d, 'p> Checks<'d, 'p> {
|
||||||
return Ok(typos_found);
|
return Ok(typos_found);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut buffer = Vec::new();
|
let buffer = std::fs::read(path)?;
|
||||||
File::open(path)?.read_to_end(&mut buffer)?;
|
|
||||||
if !explicit && !self.binary && buffer.find_byte(b'\0').is_some() {
|
if !explicit && !self.binary && buffer.find_byte(b'\0').is_some() {
|
||||||
let msg = report::BinaryFile {
|
let msg = report::BinaryFile {
|
||||||
path,
|
path,
|
||||||
|
|
Loading…
Add table
Reference in a new issue