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

This commit is contained in:
Michal Budzynski 2017-08-01 11:49:23 +02:00 committed by Sebastian Dröge
parent e38c079c9e
commit 1ee8d79d45
2 changed files with 6 additions and 6 deletions

View file

@ -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,

View file

@ -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,