From 0c98468a8df737d8e2785b95fbfdf86f143089b2 Mon Sep 17 00:00:00 2001 From: Thomas Jung Date: Tue, 2 Jun 2020 07:35:06 +0200 Subject: [PATCH] Rename to Source provide --- src/chunks.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chunks.rs b/src/chunks.rs index a42872c..b159c28 100644 --- a/src/chunks.rs +++ b/src/chunks.rs @@ -53,7 +53,7 @@ impl Iterator for Chunks { let start = (self.count as u64) * self.chunk_size; self.count += 1; - let input = self.source.call().ok()?; + let input = self.source.provide().ok()?; let (chunk, position) = Chunk::new(input, self.chunk_size, self.position, start, self.size).ok()?; self.position = position; @@ -129,7 +129,7 @@ where pub trait ChunkSource: Sized { type Item: Seek + BufRead; - fn call(&self) -> anyhow::Result; + fn provide(&self) -> anyhow::Result; } pub struct FileChunks { @@ -139,7 +139,7 @@ pub struct FileChunks { impl ChunkSource for FileChunks { type Item = BufReader; - fn call(&self) -> anyhow::Result { + fn provide(&self) -> anyhow::Result { File::open(&self.path) .map(BufReader::new) .with_context(|| "Failed") @@ -204,7 +204,7 @@ mod tests { impl ChunkSource for MemoryChunks { type Item = Cursor>; - fn call(&self) -> anyhow::Result { + fn provide(&self) -> anyhow::Result { Ok(Cursor::new(self.bytes.clone())) } }