From c2122a210cbcca822feff9f6a511ef9740d39678 Mon Sep 17 00:00:00 2001 From: Conrad Dean Date: Tue, 23 Jul 2019 10:38:59 -0400 Subject: [PATCH] fix compiler warnings --- db-traits/lib.rs | 1 - db/src/tx.rs | 2 +- public-traits/errors.rs | 2 +- query-pull/src/lib.rs | 8 ++++---- tolstoy-traits/errors.rs | 2 +- tolstoy/src/syncer.rs | 1 - 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/db-traits/lib.rs b/db-traits/lib.rs index 3a05f1c2..f2e5acc0 100644 --- a/db-traits/lib.rs +++ b/db-traits/lib.rs @@ -10,7 +10,6 @@ extern crate failure; -#[macro_use] extern crate failure_derive; extern crate rusqlite; diff --git a/db/src/tx.rs b/db/src/tx.rs index 7669622d..25c700a1 100644 --- a/db/src/tx.rs +++ b/db/src/tx.rs @@ -774,7 +774,7 @@ impl<'conn, 'a, W> Tx<'conn, 'a, W> where W: TransactWatcher { tx_might_update_metadata = true; } - let mut queue = match (attribute.fulltext, attribute.multival) { + let queue = match (attribute.fulltext, attribute.multival) { (false, true) => &mut non_fts_many, (false, false) => &mut non_fts_one, (true, false) => &mut fts_one, diff --git a/public-traits/errors.rs b/public-traits/errors.rs index ff57d337..f8906baa 100644 --- a/public-traits/errors.rs +++ b/public-traits/errors.rs @@ -154,7 +154,7 @@ impl From for MentatError { impl From for MentatError { fn from(error: rusqlite::Error) -> MentatError { - let cause = match error.cause() { + let cause = match error.source() { Some(e) => e.to_string(), None => "".to_string() }; diff --git a/query-pull/src/lib.rs b/query-pull/src/lib.rs index 1a437955..658590fa 100644 --- a/query-pull/src/lib.rs +++ b/query-pull/src/lib.rs @@ -248,9 +248,9 @@ impl Puller { // Collect :db/id if requested. if let Some(ref alias) = self.db_id_alias { for e in entities.iter() { - let mut r = maps.entry(*e) + let r = maps.entry(*e) .or_insert(ValueRc::new(StructuredMap::default())); - let mut m = ValueRc::get_mut(r).unwrap(); + let m = ValueRc::get_mut(r).unwrap(); m.insert(alias.clone(), Binding::Scalar(TypedValue::Ref(*e))); } } @@ -261,12 +261,12 @@ impl Puller { for e in entities.iter() { if let Some(binding) = cache.binding_for_e(*e) { - let mut r = maps.entry(*e) + let r = maps.entry(*e) .or_insert(ValueRc::new(StructuredMap::default())); // Get into the inner map so we can accumulate a value. // We can unwrap here because we created all of these maps… - let mut m = ValueRc::get_mut(r).unwrap(); + let m = ValueRc::get_mut(r).unwrap(); m.insert(name.clone(), binding); } diff --git a/tolstoy-traits/errors.rs b/tolstoy-traits/errors.rs index 5d6739f6..40b4461b 100644 --- a/tolstoy-traits/errors.rs +++ b/tolstoy-traits/errors.rs @@ -81,7 +81,7 @@ impl From for TolstoyError { impl From for TolstoyError { fn from(error: rusqlite::Error) -> TolstoyError { - let cause = match error.cause() { + let cause = match error.source() { Some(e) => e.to_string(), None => "".to_string() }; diff --git a/tolstoy/src/syncer.rs b/tolstoy/src/syncer.rs index 6d169503..f7577b22 100644 --- a/tolstoy/src/syncer.rs +++ b/tolstoy/src/syncer.rs @@ -32,7 +32,6 @@ use edn::entities::{ use mentat_db::{ CORE_SCHEMA_VERSION, timelines, - debug, entids, PartitionMap, };