Post: Use a single implementation of bail macro

This commit is contained in:
Grisha Kruglov 2018-08-08 16:36:23 -07:00 committed by Grisha Kruglov
parent e9398dd50d
commit 1e488d720b
14 changed files with 15 additions and 49 deletions

View file

@ -81,6 +81,13 @@ pub use value_type_set::{
ValueTypeSet,
};
#[macro_export]
macro_rules! bail {
($e:expr) => (
return Err($e.into());
)
}
/// Represents one entid in the entid space.
///
/// Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite

View file

@ -34,13 +34,6 @@ use core_traits::{
ValueType,
};
#[macro_export]
macro_rules! bail {
($e:expr) => (
return Err($e.into());
)
}
pub type Result<T> = ::std::result::Result<T, DbError>;
// TODO Error/ErrorKind pair

View file

@ -24,8 +24,8 @@ extern crate time;
#[macro_use] extern crate edn;
#[macro_use] extern crate mentat_core;
#[macro_use] extern crate db_traits;
extern crate core_traits;
extern crate db_traits;
#[macro_use] extern crate core_traits;
extern crate mentat_sql;
use std::iter::repeat;

View file

@ -44,13 +44,6 @@ use tolstoy_traits::errors::{
pub type Result<T> = std::result::Result<T, MentatError>;
#[macro_export]
macro_rules! bail {
($e:expr) => (
return Err($e.into());
)
}
#[derive(Debug, Fail)]
pub enum MentatError {
#[fail(display = "bad uuid {}", _0)]

View file

@ -25,13 +25,6 @@ use edn::query::{
pub type Result<T> = std::result::Result<T, AlgebrizerError>;
#[macro_export]
macro_rules! bail {
($e:expr) => (
return Err($e.into());
)
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum BindingError {
NoBoundVariable,

View file

@ -12,8 +12,8 @@ extern crate failure;
extern crate edn;
extern crate mentat_core;
extern crate core_traits;
#[macro_use]
extern crate core_traits;
extern crate query_algebrizer_traits;
use std::collections::BTreeSet;

View file

@ -27,13 +27,6 @@ use aggregates::{
SimpleAggregationOp,
};
#[macro_export]
macro_rules! bail {
($e:expr) => (
return Err($e.into());
)
}
pub type Result<T> = std::result::Result<T, ProjectorError>;
#[derive(Debug, Fail)]

View file

@ -13,6 +13,7 @@ extern crate failure;
extern crate failure_derive;
extern crate rusqlite;
#[macro_use]
extern crate core_traits;
extern crate db_traits;
extern crate edn;
@ -22,7 +23,6 @@ extern crate query_pull_traits;
extern crate mentat_query_algebrizer;
extern crate mentat_query_sql;
#[macro_use]
pub mod errors;
pub mod aggregates;

View file

@ -16,12 +16,12 @@ extern crate rusqlite;
extern crate edn;
extern crate mentat_core;
extern crate db_traits;
#[macro_use]
extern crate core_traits;
extern crate mentat_db; // For value conversion.
extern crate mentat_query_algebrizer;
extern crate mentat_query_pull;
extern crate query_pull_traits;
#[macro_use]
extern crate query_projector_traits;
extern crate mentat_query_sql;
extern crate mentat_sql;

View file

@ -21,6 +21,7 @@ extern crate uuid;
pub extern crate edn;
extern crate mentat_core;
#[macro_use]
extern crate core_traits;
extern crate mentat_db;
extern crate db_traits;
@ -32,7 +33,6 @@ extern crate mentat_query_pull;
extern crate query_pull_traits;
extern crate sql_traits;
extern crate mentat_sql;
#[macro_use]
extern crate public_traits;
#[cfg(feature = "syncable")]

View file

@ -16,13 +16,6 @@ use serde_json;
use db_traits::errors::DbError;
#[macro_export]
macro_rules! bail {
($e:expr) => (
return Err($e.into());
)
}
pub type Result<T> = ::std::result::Result<T, TolstoyError>;
#[derive(Debug, Fail)]

View file

@ -33,11 +33,11 @@ extern crate serde_json;
extern crate mentat_core;
extern crate db_traits;
#[macro_use]
extern crate core_traits;
extern crate rusqlite;
extern crate uuid;
#[macro_use]
extern crate tolstoy_traits;
pub mod schema;

View file

@ -43,13 +43,6 @@ use mentat::{
CacheDirection,
};
#[macro_export]
macro_rules! bail {
($e:expr) => (
return Err($e.into());
)
}
pub static COMMAND_CACHE: &'static str = &"cache";
pub static COMMAND_CLOSE: &'static str = &"close";
pub static COMMAND_EXIT_LONG: &'static str = &"exit";

View file

@ -30,6 +30,7 @@ extern crate time;
extern crate mentat;
extern crate edn;
#[macro_use]
extern crate core_traits;
extern crate mentat_db;