Skip to content

Commit

Permalink
Cleaned up minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jblondin committed Mar 31, 2018
1 parent ea2b05e commit d964e42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ impl<'a, R: Read> Iterator for SampleIter<'a, R> {
let last_byte = (output.as_ref() as &[u8])[output.len() - 1];
if last_byte != b'\n' && last_byte != b'\r' {
// non CR/LF-ended line
// line was cut off before ending, so we ignore it!
self.is_done = true;
return None;
} else {
Expand Down
4 changes: 1 addition & 3 deletions src/sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ impl Sniffer {
}

/// The size of the sample to examine while sniffing. If using `SampleSize::Records`, the
/// sniffer will use the value provided with `terminator()` (or `Terminator::CRLF` if no
/// terminator is provided). Thus, `SampleSize::Records` may work unexpectedly for
/// non-CRLF-terminated files if the terminator is not provided.
/// sniffer will use the `Terminator::CRLF` as record separator.
///
/// The sample size defaults to `SampleSize::Bytes(4096)`.
pub fn sample_size(&mut self, sample_size: SampleSize) -> &mut Sniffer {
Expand Down
3 changes: 3 additions & 0 deletions src/snip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ use error::*;
pub(crate) fn preamble_skipcount<R: Read>(reader: &mut R, n_preamble_rows: usize)
-> Result<usize>
{
if n_preamble_rows == 0 {
return Ok(0);
}
let mut skipcount = 0;
loop {
let cap = 1 << 12;
Expand Down

0 comments on commit d964e42

Please sign in to comment.