Fix Rust 1.37.0 compiler warnings (#5530)

Looks like most usages of trait objects should have introduced
a type variable instead.
This commit is contained in:
Greg Fitzgerald
2019-08-15 14:00:09 -06:00
committed by GitHub
parent 75a2b74751
commit 471bc73a23
13 changed files with 33 additions and 25 deletions

View File

@@ -332,7 +332,7 @@ fn load_tables(root: &Path, mapper: &dyn Mapper) -> Result<Vec<BTreeMap<Key, SST
Ok(tables)
}
fn dump_tables(root: &Path, mapper: &Mapper) -> Result<()> {
fn dump_tables(root: &Path, mapper: &dyn Mapper) -> Result<()> {
mapper.serialize_state_to(&root.join(TABLES_FILE))?;
Ok(())
}

View File

@@ -12,7 +12,7 @@ pub use self::disk::Disk;
pub use self::memory::Memory;
pub trait Mapper: std::fmt::Debug + Send + Sync {
fn make_table(&self, kind: Kind, func: &mut FnMut(Writer, Writer)) -> Result<SSTable>;
fn make_table(&self, kind: Kind, func: &mut dyn FnMut(Writer, Writer)) -> Result<SSTable>;
fn rotate_tables(&self) -> Result<()>;
fn empty_trash(&self) -> Result<()>;
fn active_set(&self) -> Result<Vec<SSTable>>;

View File

@@ -78,7 +78,7 @@ impl Disk {
}
impl Mapper for Disk {
fn make_table(&self, kind: Kind, func: &mut FnMut(Writer, Writer)) -> Result<SSTable> {
fn make_table(&self, kind: Kind, func: &mut dyn FnMut(Writer, Writer)) -> Result<SSTable> {
let storage = self.choose_storage();
let id = next_id(kind);

View File

@@ -51,7 +51,7 @@ impl Memory {
}
impl Mapper for Memory {
fn make_table(&self, kind: Kind, func: &mut FnMut(Writer, Writer)) -> Result<SSTable> {
fn make_table(&self, kind: Kind, func: &mut dyn FnMut(Writer, Writer)) -> Result<SSTable> {
let backing = self.get_backing(kind);
let id = next_id();

View File

@@ -109,7 +109,7 @@ trait LogWriter: std::fmt::Debug + Write + Send + Sync {
/// Holds actual logging related state
#[derive(Debug)]
struct Logger {
writer: Box<LogWriter>,
writer: Box<dyn LogWriter>,
}
impl Logger {