diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index 7e8eaa49..a665b25a 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -67,9 +67,12 @@ //! propogation. These types have implemented [From](std::convert::From) such that conversion from the Rust type //! to the C type is as painless as possible. +extern crate core; extern crate libc; extern crate mentat; +use core::fmt::Display; + use std::collections::{ BTreeSet, }; @@ -204,7 +207,7 @@ pub struct ExternResult { pub err: *const c_char, } -impl From> for ExternResult where E: std::error::Error { +impl From> for ExternResult where E: Display { fn from(result: Result) -> Self { match result { Ok(value) => { diff --git a/tools/cli/src/mentat_cli/errors.rs b/tools/cli/src/mentat_cli/errors.rs deleted file mode 100644 index 0012c319..00000000 --- a/tools/cli/src/mentat_cli/errors.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 Mozilla -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#![allow(dead_code)] - -use rusqlite; - -use mentat::errors as mentat; - -error_chain! { - types { - Error, ErrorKind, ResultExt, Result; - } - - foreign_links { - Rusqlite(rusqlite::Error); - IoError(::std::io::Error); - } - - links { - MentatError(mentat::Error, mentat::ErrorKind); - } - - errors { - CommandParse(message: String) { - description("An error occured parsing the entered command") - display("{}", message) - } - } -}