From ced9c67adbcf7deec281dbdc09250151e61a9ff7 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 28 Oct 2020 12:21:02 +1300 Subject: [PATCH] Remove util module Signed-off-by: Nick Cameron --- tikv-client-common/src/errors.rs | 13 +++++++++++++ tikv-client-common/src/lib.rs | 3 +-- tikv-client-common/src/util.rs | 14 -------------- 3 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 tikv-client-common/src/util.rs diff --git a/tikv-client-common/src/errors.rs b/tikv-client-common/src/errors.rs index 900045a..54b8df2 100644 --- a/tikv-client-common/src/errors.rs +++ b/tikv-client-common/src/errors.rs @@ -191,3 +191,16 @@ impl From for Error { /// A result holding an [`Error`](Error). pub type Result = result::Result; + +#[macro_export] +macro_rules! internal_err { + ($e:expr) => ({ + let kind = $crate::Error::internal_error( + format!("[{}:{}]: {}", file!(), line!(), $e) + ); + $crate::Error::from(kind) + }); + ($f:tt, $($arg:expr),+) => ({ + internal_err!(format!($f, $($arg),+)) + }); +} diff --git a/tikv-client-common/src/lib.rs b/tikv-client-common/src/lib.rs index 77afa41..41da9e0 100644 --- a/tikv-client-common/src/lib.rs +++ b/tikv-client-common/src/lib.rs @@ -1,6 +1,5 @@ -#[macro_use] -pub mod util; pub mod config; +#[macro_use] pub mod errors; pub mod kv; pub mod security; diff --git a/tikv-client-common/src/util.rs b/tikv-client-common/src/util.rs deleted file mode 100644 index 989074a..0000000 --- a/tikv-client-common/src/util.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0. - -#[macro_export] -macro_rules! internal_err { - ($e:expr) => ({ - let kind = $crate::Error::internal_error( - format!("[{}:{}]: {}", file!(), line!(), $e) - ); - $crate::Error::from(kind) - }); - ($f:tt, $($arg:expr),+) => ({ - internal_err!(format!($f, $($arg),+)) - }); -}