Commit 1ee8d79d authored by Michał Budzyński's avatar Michał Budzyński Committed by Sebastian Dröge
Browse files

Removed `self.logger.clone()` in filesink/filesrc with split borrows

parent e38c079c
......@@ -111,12 +111,12 @@ impl Sink for FileSink {
}
fn render(&mut self, buffer: &Buffer) -> Result<(), FlowError> {
// FIXME: Because we borrow streaming state mutably below
let logger = self.logger.clone();
let logger = &self.logger;
let streaming_state = &mut self.streaming_state;
trace!(logger, "Rendering {:?}", buffer);
let (file, position) = match self.streaming_state {
let (file, position) = match *streaming_state {
StreamingState::Started {
ref mut file,
ref mut position,
......
......@@ -120,10 +120,10 @@ impl Source for FileSrc {
}
fn fill(&mut self, offset: u64, _: u32, buffer: &mut Buffer) -> Result<(), FlowError> {
// FIXME: Because we borrow streaming state mutably below
let logger = self.logger.clone();
let logger = &self.logger;
let streaming_state = &mut self.streaming_state;
let (file, position) = match self.streaming_state {
let (file, position) = match *streaming_state {
StreamingState::Started {
ref mut file,
ref mut position,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment