Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #53 from nikomatsakis/master
Browse files Browse the repository at this point in the history
fix incorrect impl method declarations
  • Loading branch information
dhardy authored Feb 6, 2017
2 parents 98fa749 + 413525e commit ebd7489
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fileio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl PartIO for PartFileIO {
self.paths.paths.get(ss_num).map(|&(ref p, _)| p.is_some()).unwrap_or(false)
}

fn read_ss<'a>(&self, ss_num: usize) -> Result<Option<Box<Read+'a>>> {
fn read_ss<'a>(&'a self, ss_num: usize) -> Result<Option<Box<Read+'a>>> {
// Cannot replace `match` with `map` since `try!()` cannot be used in a closure
Ok(match self.paths.paths.get(ss_num) {
Some(&(ref p, _)) => {
Expand All @@ -205,7 +205,7 @@ impl PartIO for PartFileIO {
})
}

fn read_ss_cl<'a>(&self, ss_num: usize, cl_num: usize) -> Result<Option<Box<Read+'a>>> {
fn read_ss_cl<'a>(&'a self, ss_num: usize, cl_num: usize) -> Result<Option<Box<Read+'a>>> {
Ok(match self.paths.paths.get(ss_num).and_then(|&(_, ref logs)| logs.get(cl_num)) {
Some(p) => {
trace!("Reading log file: {}", p.display());
Expand All @@ -215,7 +215,7 @@ impl PartIO for PartFileIO {
})
}

fn new_ss<'a>(&mut self, ss_num: usize) -> Result<Option<Box<Write+'a>>> {
fn new_ss<'a>(&'a mut self, ss_num: usize) -> Result<Option<Box<Write+'a>>> {
if self.readonly {
return ReadOnly::err();
}
Expand All @@ -235,7 +235,7 @@ impl PartIO for PartFileIO {
Ok(Some(Box::new(stream)))
}

fn append_ss_cl<'a>(&mut self, ss_num: usize, cl_num: usize) -> Result<Option<Box<Write+'a>>> {
fn append_ss_cl<'a>(&'a mut self, ss_num: usize, cl_num: usize) -> Result<Option<Box<Write+'a>>> {
if self.readonly {
return ReadOnly::err();
}
Expand All @@ -247,7 +247,7 @@ impl PartIO for PartFileIO {
None => None
})
}
fn new_ss_cl<'a>(&mut self, ss_num: usize, cl_num: usize) -> Result<Option<Box<Write+'a>>> {
fn new_ss_cl<'a>(&'a mut self, ss_num: usize, cl_num: usize) -> Result<Option<Box<Write+'a>>> {
if self.readonly {
return ReadOnly::err();
}
Expand Down

0 comments on commit ebd7489

Please sign in to comment.