diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-20 20:17:26 +0100 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-20 20:17:26 +0100 |
| commit | ad9ab3f0761af1751e0e2d19b140f8c8fc5e3324 (patch) | |
| tree | 72feff72ef48875aeb35b5c34c5603bcca9bb0f4 | |
| parent | 0694f95bfac3be74c33605f947d324890d843c0e (diff) | |
| download | mail-ad9ab3f0761af1751e0e2d19b140f8c8fc5e3324.tar.gz | |
fix some compiler warning regarding opaque structs
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | src/error.rs | 1 | ||||
| -rw-r--r-- | src/ffi.rs | 26 | ||||
| -rw-r--r-- | src/lib.rs | 2 | ||||
| -rw-r--r-- | src/utils.rs | 2 |
5 files changed, 13 insertions, 19 deletions
@@ -5,5 +5,4 @@ authors = ["C. Morgan Hamill <me@cmhamill.org>", "Dirk Van Haerenborgh <vhdirk@gmail.com>"] [dependencies] -notmuch-sys = "*" libc = "0.2" diff --git a/src/error.rs b/src/error.rs index 046e17f..b1e5cdc 100644 --- a/src/error.rs +++ b/src/error.rs @@ -6,7 +6,6 @@ use std::{ result, }; -use ffi_sys; use ffi; pub type Result<T> = result::Result<T, Error>; @@ -27,7 +27,7 @@ pub type notmuch_compact_status_cb_t = extern fn(*const c_char, *mut c_void); notmuch_enum! { #[repr(C)] - #[derive(Copy, Clone, Debug)] + #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub enum notmuch_status_t => Status { NOTMUCH_STATUS_SUCCESS => Success, NOTMUCH_STATUS_OUT_OF_MEMORY => OutOfMemory, @@ -86,7 +86,7 @@ impl error::Error for Status { notmuch_enum! { #[repr(C)] - #[derive(Copy, Clone, Debug)] + #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub enum notmuch_database_mode_t => Mode { NOTMUCH_DATABASE_MODE_READ_ONLY => ReadOnly, NOTMUCH_DATABASE_MODE_READ_WRITE => ReadWrite @@ -95,7 +95,7 @@ notmuch_enum! { notmuch_enum! { #[repr(C)] - #[derive(Copy, Clone, Debug)] + #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub enum notmuch_sort_t => Sort { NOTMUCH_SORT_OLDEST_FIRST => OldestFirst, NOTMUCH_SORT_NEWEST_FIRST => NewestFirst, @@ -117,7 +117,7 @@ notmuch_enum! { notmuch_enum! { #[repr(C)] - #[derive(Copy, Clone, Debug)] + #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub enum notmuch_message_flag_t => MessageFlag { NOTMUCH_MESSAGE_FLAG_MATCH => Match, NOTMUCH_MESSAGE_FLAG_EXCLUDED => Excluded, @@ -125,15 +125,15 @@ notmuch_enum! { } } -#[repr(C)] pub struct notmuch_database_t; -#[repr(C)] pub struct notmuch_query_t; -#[repr(C)] pub struct notmuch_threads_t; -#[repr(C)] pub struct notmuch_thread_t; -#[repr(C)] pub struct notmuch_messages_t; -#[repr(C)] pub struct notmuch_message_t; -#[repr(C)] pub struct notmuch_tags_t; -#[repr(C)] pub struct notmuch_directory_t; -#[repr(C)] pub struct notmuch_filenames_t; +#[repr(C)] pub struct notmuch_database_t(c_void); +#[repr(C)] pub struct notmuch_query_t(c_void); +#[repr(C)] pub struct notmuch_threads_t(c_void); +#[repr(C)] pub struct notmuch_thread_t(c_void); +#[repr(C)] pub struct notmuch_messages_t(c_void); +#[repr(C)] pub struct notmuch_message_t(c_void); +#[repr(C)] pub struct notmuch_tags_t(c_void); +#[repr(C)] pub struct notmuch_directory_t(c_void); +#[repr(C)] pub struct notmuch_filenames_t(c_void); #[link(name = "notmuch")] extern { @@ -1,8 +1,6 @@ - #[macro_use] mod macros; -extern crate notmuch_sys as ffi_sys; extern crate libc; mod utils; diff --git a/src/utils.rs b/src/utils.rs index af3ce29..8aad8f7 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -4,8 +4,6 @@ use std::{ str, }; -use std::os::unix::ffi::OsStrExt; - use libc; pub trait NewFromPtr<T> { |
