diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-12-15 15:36:21 +0100 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-12-15 15:36:21 +0100 |
| commit | 895fee066eed58e18c2633cf7d0fa870a65ac06d (patch) | |
| tree | fefa2c6d2c312385986364eddcab9a02f53d966a | |
| parent | c94fd1bbaf85446e04c01fceef3b8e5471e2cbea (diff) | |
| download | mail-895fee066eed58e18c2633cf7d0fa870a65ac06d.tar.gz | |
Revert "Edition 2018 hit stable 🙌"
This reverts commit b5b0f7e97abe0dbd5b54a1fc69e764a124c271b2.
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | src/database.rs | 23 | ||||
| -rw-r--r-- | src/directory.rs | 12 | ||||
| -rw-r--r-- | src/error.rs | 12 | ||||
| -rw-r--r-- | src/ffi.rs | 6 | ||||
| -rw-r--r-- | src/filenames.rs | 6 | ||||
| -rw-r--r-- | src/lib.rs | 26 | ||||
| -rw-r--r-- | src/message.rs | 24 | ||||
| -rw-r--r-- | src/messages.rs | 14 | ||||
| -rw-r--r-- | src/query.rs | 18 | ||||
| -rw-r--r-- | src/tags.rs | 6 | ||||
| -rw-r--r-- | src/thread.rs | 14 | ||||
| -rw-r--r-- | src/threads.rs | 8 | ||||
| -rw-r--r-- | tests/main.rs | 4 |
14 files changed, 87 insertions, 87 deletions
@@ -7,7 +7,6 @@ repository = "https://github.com/vhdirk/notmuch-rs" description = "Rust interface and bindings for notmuch" license = "GPL-3.0+" readme = "README.md" -edition = "2018" [badges] travis-ci = { repository = "vhdirk/notmuch-rs" } diff --git a/src/database.rs b/src/database.rs index 19d33c7..f4ef444 100644 --- a/src/database.rs +++ b/src/database.rs @@ -7,19 +7,20 @@ use supercow::Supercow; use libc; -use crate::error::{Error, Result}; -use crate::ffi; -use crate::ffi::Status; -use crate::query::QueryPtr; -use crate::utils::ToStr; -use crate::Directory; -use crate::Query; -use crate::Tags; -use crate::TagsOwner; -use crate::utils::ScopedSupercow; +use error::{Error, Result}; +use ffi; +use ffi::Status; +use query::QueryPtr; +use utils::ToStr; +use Directory; +use Query; +use Tags; +use TagsOwner; +use utils::ScopedSupercow; + // Re-exported under database module for pretty namespacin'. -pub use crate::ffi::DatabaseMode; +pub use ffi::DatabaseMode; #[derive(Copy, Clone, Debug)] pub struct Version(libc::c_uint); diff --git a/src/directory.rs b/src/directory.rs index 6402902..1aff32b 100644 --- a/src/directory.rs +++ b/src/directory.rs @@ -1,11 +1,11 @@ use std::ops::Drop; use supercow::Supercow; -use crate::ffi; -use crate::Database; -use crate::Filenames; -use crate::FilenamesOwner; -use crate::utils::{ScopedSupercow, ScopedPhantomcow}; +use ffi; +use Database; +use Filenames; +use FilenamesOwner; +use utils::{ScopedSupercow, ScopedPhantomcow}; #[derive(Debug)] pub(crate) struct DirectoryPtr { @@ -37,7 +37,7 @@ impl<'d> Directory<'d> { } } - pub fn child_directories(&self) -> Filenames<'_, Self> { + pub fn child_directories(&self) -> Filenames<Self> { <Self as DirectoryExt>::child_directories(self) } } diff --git a/src/error.rs b/src/error.rs index 3eba2ba..824cc39 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,7 +1,7 @@ use std; use std::{error, fmt, io, result}; -use crate::ffi; +use ffi; pub type Result<T> = result::Result<T, Error>; @@ -13,7 +13,7 @@ pub enum Error { } impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", error::Error::description(self)) } } @@ -27,10 +27,10 @@ impl std::error::Error for Error { } } - fn cause(&self) -> Option<&dyn error::Error> { - match self { - Error::IoError(e) => Some(e), - Error::NotmuchError(e) => Some(e), + fn cause(&self) -> Option<&error::Error> { + match *self { + Error::IoError(ref e) => Some(e), + Error::NotmuchError(ref e) => Some(e), Error::UnspecifiedError => None, } } @@ -4,10 +4,10 @@ use libc::{c_char, c_double, c_int, c_uint, c_ulong, c_void, time_t}; -use crate::error::{Error, Result}; +use error::{Error, Result}; use std::{error, fmt, str}; -use crate::utils::ToStr; +use utils::ToStr; notmuch_enum! { #[repr(C)] @@ -60,7 +60,7 @@ impl ToStr for Status { } impl fmt::Display for Status { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.to_str().unwrap()) } } diff --git a/src/filenames.rs b/src/filenames.rs index 24ce513..94eb5b7 100644 --- a/src/filenames.rs +++ b/src/filenames.rs @@ -3,8 +3,8 @@ use std::iter::Iterator; use std::ops::Drop; use std::path::PathBuf; -use crate::ffi; -use crate::utils::ScopedPhantomcow; +use ffi; +use utils::ScopedPhantomcow; pub trait FilenamesOwner {} @@ -26,7 +26,7 @@ impl Drop for FilenamesPtr { #[derive(Debug)] pub struct Filenames<'o, O> where - O: FilenamesOwner, + O: FilenamesOwner + 'o, { pub(crate) handle: FilenamesPtr, pub(crate) marker: ScopedPhantomcow<'o, O>, @@ -4,8 +4,8 @@ #[macro_use] mod macros; -use libc; - +extern crate libc; +extern crate supercow; mod ffi; mod utils; @@ -21,15 +21,15 @@ mod tags; mod thread; mod threads; -pub use crate::database::{Database, DatabaseExt}; -pub use crate::directory::{Directory, DirectoryExt}; -pub use crate::error::Error; -pub use crate::filenames::{Filenames, FilenamesOwner}; -pub use crate::message::{Message, MessageExt, MessageOwner}; -pub use crate::messages::{Messages, MessagesExt}; -pub use crate::query::{Query, QueryExt}; -pub use crate::tags::{Tags, TagsExt, TagsOwner}; -pub use crate::thread::{Thread, ThreadExt}; -pub use crate::threads::{Threads, ThreadsExt}; +pub use database::{Database, DatabaseExt}; +pub use directory::{Directory, DirectoryExt}; +pub use error::Error; +pub use filenames::{Filenames, FilenamesOwner}; +pub use message::{Message, MessageExt, MessageOwner}; +pub use messages::{Messages, MessagesExt}; +pub use query::{Query, QueryExt}; +pub use tags::{Tags, TagsExt, TagsOwner}; +pub use thread::{Thread, ThreadExt}; +pub use threads::{Threads, ThreadsExt}; -pub use crate::ffi::{DatabaseMode, Sort}; +pub use ffi::{DatabaseMode, Sort};
\ No newline at end of file diff --git a/src/message.rs b/src/message.rs index baa638d..8cc7af2 100644 --- a/src/message.rs +++ b/src/message.rs @@ -2,14 +2,14 @@ use std::ffi::CString; use std::path::PathBuf; use supercow::{Supercow}; -use crate::error::{Error, Result}; -use crate::ffi; -use crate::utils::{ToStr, ScopedPhantomcow, ScopedSupercow}; -use crate::Filenames; -use crate::FilenamesOwner; -use crate::Messages; -use crate::Tags; -use crate::TagsOwner; +use error::{Error, Result}; +use ffi; +use utils::{ToStr, ScopedPhantomcow, ScopedSupercow}; +use Filenames; +use FilenamesOwner; +use Messages; +use Tags; +use TagsOwner; pub trait MessageOwner: Send + Sync {} @@ -21,7 +21,7 @@ pub(crate) struct MessagePtr { #[derive(Debug)] pub struct Message<'o, O> where - O: MessageOwner, + O: MessageOwner + 'o, { pub(crate) handle: MessagePtr, marker: ScopedPhantomcow<'o, O>, @@ -55,7 +55,7 @@ where tid.to_str().unwrap().to_string() } - pub fn replies(self: &Self) -> Messages<'_, Self> { + pub fn replies(self: &Self) -> Messages<Self> { <Self as MessageExt<'o, O>>::replies(self) } @@ -64,7 +64,7 @@ where unsafe { ffi::notmuch_message_count_files(self.handle.ptr) } } - pub fn filenames(self: &Self) -> Filenames<'_, Self> { + pub fn filenames(self: &Self) -> Filenames<Self> { <Self as MessageExt<'o, O>>::filenames(self) } @@ -93,7 +93,7 @@ where } } - pub fn tags(&self) -> Tags<'_, Self> { + pub fn tags(&self) -> Tags<Self> { <Self as MessageExt<'o, O>>::tags(self) } diff --git a/src/messages.rs b/src/messages.rs index 64b4090..db92f73 100644 --- a/src/messages.rs +++ b/src/messages.rs @@ -1,11 +1,11 @@ use std::ops::Drop; -use crate::ffi; -use crate::utils::ScopedPhantomcow; -use crate::MessageOwner; -use crate::Message; -use crate::Tags; -use crate::TagsOwner; +use ffi; +use utils::ScopedPhantomcow; +use MessageOwner; +use Message; +use Tags; +use TagsOwner; #[derive(Debug)] pub struct MessagesPtr { @@ -21,7 +21,7 @@ impl Drop for MessagesPtr { #[derive(Debug)] pub struct Messages<'o, O> where - O: MessageOwner, + O: MessageOwner + 'o, { pub(crate) handle: MessagesPtr, marker: ScopedPhantomcow<'o, O>, diff --git a/src/query.rs b/src/query.rs index 9a04c7a..adbed58 100644 --- a/src/query.rs +++ b/src/query.rs @@ -3,14 +3,14 @@ use std::ptr; use supercow::{Phantomcow, Supercow}; -use crate::error::Result; -use crate::ffi; -use crate::ffi::Sort; -use crate::Database; -use crate::Messages; -use crate::MessageOwner; -use crate::Threads; -use crate::utils::ScopedSupercow; +use error::Result; +use ffi; +use ffi::Sort; +use Database; +use Messages; +use MessageOwner; +use Threads; +use utils::ScopedSupercow; #[derive(Debug)] pub(crate) struct QueryPtr { @@ -76,7 +76,7 @@ impl<'d> Query<'d> { /// Filter messages according to the query and return pub fn search_messages<'q>(self: &'d Self) -> Result<Messages<'q, Self>> { - <Query<'_> as QueryExt>::search_messages(self) + <Query as QueryExt>::search_messages(self) } pub fn count_messages(self: &Self) -> Result<u32> { diff --git a/src/tags.rs b/src/tags.rs index 215bb8a..df9e854 100644 --- a/src/tags.rs +++ b/src/tags.rs @@ -2,8 +2,8 @@ use std::ffi::CStr; use std::iter::Iterator; use std::ops::Drop; -use crate::ffi; -use crate::utils::ScopedPhantomcow; +use ffi; +use utils::ScopedPhantomcow; pub trait TagsOwner {} @@ -19,7 +19,7 @@ impl Drop for TagsPtr { } #[derive(Debug)] -pub struct Tags<'o, Owner: TagsOwner> { +pub struct Tags<'o, Owner: TagsOwner + 'o> { handle: TagsPtr, marker: ScopedPhantomcow<'o, Owner>, } diff --git a/src/thread.rs b/src/thread.rs index b3cd151..137c936 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -1,12 +1,12 @@ use std::ops::Drop; -use crate::ffi; -use crate::utils::{ToStr, ScopedSupercow, ScopedPhantomcow}; -use crate::Messages; -use crate::MessageOwner; -use crate::Tags; -use crate::TagsOwner; -use crate::Query; +use ffi; +use utils::{ToStr, ScopedSupercow, ScopedPhantomcow}; +use Messages; +use MessageOwner; +use Tags; +use TagsOwner; +use Query; #[derive(Debug)] pub(crate) struct ThreadPtr { diff --git a/src/threads.rs b/src/threads.rs index 4aa5a9b..6d1e8e4 100644 --- a/src/threads.rs +++ b/src/threads.rs @@ -1,9 +1,9 @@ use std::ops::Drop; -use crate::ffi; -use crate::Thread; -use crate::Query; -use crate::utils::ScopedPhantomcow; +use ffi; +use Thread; +use Query; +use utils::ScopedPhantomcow; #[derive(Debug)] diff --git a/tests/main.rs b/tests/main.rs index 8a857dd..5789824 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -1,5 +1,5 @@ -use dirs; -use notmuch; +extern crate dirs; +extern crate notmuch; use std::sync::Arc; |
