aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDirk Van Haerenborgh <vhdirk@gmail.com>2018-03-20 20:17:26 +0100
committerDirk Van Haerenborgh <vhdirk@gmail.com>2018-03-20 20:17:26 +0100
commitad9ab3f0761af1751e0e2d19b140f8c8fc5e3324 (patch)
tree72feff72ef48875aeb35b5c34c5603bcca9bb0f4 /src
parent0694f95bfac3be74c33605f947d324890d843c0e (diff)
downloadmail-ad9ab3f0761af1751e0e2d19b140f8c8fc5e3324.tar.gz
fix some compiler warning regarding opaque structs
Diffstat (limited to 'src')
-rw-r--r--src/error.rs1
-rw-r--r--src/ffi.rs26
-rw-r--r--src/lib.rs2
-rw-r--r--src/utils.rs2
4 files changed, 13 insertions, 18 deletions
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>;
diff --git a/src/ffi.rs b/src/ffi.rs
index 6d2ceeb..bd59941 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -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 {
diff --git a/src/lib.rs b/src/lib.rs
index 63d190f..c7984e0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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> {