fix: Use Read instead of BufRead as no BufRead method is actually used (#394)
parent
2083b41a24
commit
cf90ebe82d
|
@ -8,7 +8,7 @@ use tracing::warn;
|
|||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::i64;
|
||||
use std::io::{BufRead, Seek};
|
||||
use std::io::{Read, Seek};
|
||||
use std::iter::Peekable;
|
||||
|
||||
/// `TSMMeasurementMapper` takes a TSM reader and produces an iterator that
|
||||
|
@ -21,7 +21,7 @@ use std::iter::Peekable;
|
|||
#[derive(Debug)]
|
||||
pub struct TSMMeasurementMapper<R>
|
||||
where
|
||||
R: BufRead + Seek,
|
||||
R: Read + Seek,
|
||||
{
|
||||
iter: Peekable<TSMIndexReader<R>>,
|
||||
reader_idx: usize,
|
||||
|
@ -29,7 +29,7 @@ where
|
|||
|
||||
impl<R> TSMMeasurementMapper<R>
|
||||
where
|
||||
R: BufRead + Seek,
|
||||
R: Read + Seek,
|
||||
{
|
||||
pub fn new(iter: Peekable<TSMIndexReader<R>>, reader_idx: usize) -> Self {
|
||||
Self { iter, reader_idx }
|
||||
|
@ -46,7 +46,7 @@ macro_rules! try_or_some {
|
|||
};
|
||||
}
|
||||
|
||||
impl<R: BufRead + Seek> Iterator for TSMMeasurementMapper<R> {
|
||||
impl<R: Read + Seek> Iterator for TSMMeasurementMapper<R> {
|
||||
type Item = Result<MeasurementTable, TSMError>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use super::*;
|
||||
use integer_encoding::VarInt;
|
||||
use std::collections::BTreeMap;
|
||||
use std::io::{BufRead, Seek, SeekFrom};
|
||||
use std::io::{Read, Seek, SeekFrom};
|
||||
use std::u64;
|
||||
|
||||
/// `TSMIndexReader` allows you to read index data within a TSM file.
|
||||
|
@ -48,7 +48,7 @@ use std::u64;
|
|||
#[derive(Debug)]
|
||||
pub struct TSMIndexReader<R>
|
||||
where
|
||||
R: BufRead + Seek,
|
||||
R: Read + Seek,
|
||||
{
|
||||
r: R,
|
||||
|
||||
|
@ -61,7 +61,7 @@ where
|
|||
|
||||
impl<R> TSMIndexReader<R>
|
||||
where
|
||||
R: BufRead + Seek,
|
||||
R: Read + Seek,
|
||||
{
|
||||
pub fn try_new(mut r: R, len: usize) -> Result<Self, TSMError> {
|
||||
// determine offset to index, which is held in last 8 bytes of file.
|
||||
|
@ -153,7 +153,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<R: BufRead + Seek> Iterator for TSMIndexReader<R> {
|
||||
impl<R: Read + Seek> Iterator for TSMIndexReader<R> {
|
||||
type Item = Result<IndexEntry, TSMError>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
|
@ -556,14 +556,14 @@ impl ValuePair {
|
|||
#[derive(Debug)]
|
||||
pub struct TSMBlockReader<R>
|
||||
where
|
||||
R: BufRead + Seek,
|
||||
R: Read + Seek,
|
||||
{
|
||||
readers: Vec<R>,
|
||||
}
|
||||
|
||||
impl<R> TSMBlockReader<R>
|
||||
where
|
||||
R: BufRead + Seek,
|
||||
R: Read + Seek,
|
||||
{
|
||||
pub fn new(r: R) -> Self {
|
||||
Self { readers: vec![r] }
|
||||
|
@ -576,7 +576,7 @@ where
|
|||
|
||||
impl<R> BlockDecoder for TSMBlockReader<R>
|
||||
where
|
||||
R: BufRead + Seek,
|
||||
R: Read + Seek,
|
||||
{
|
||||
/// decode a block whose location is described by the provided
|
||||
/// `Block`.
|
||||
|
|
Loading…
Reference in New Issue