aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Van Haerenborgh <vhdirk@gmail.com>2018-04-19 11:29:00 +0200
committerDirk Van Haerenborgh <vhdirk@gmail.com>2018-10-06 12:14:55 +0200
commitb49b9959b5375ed44c94f968bcebb07a7b8eac94 (patch)
tree94d423835a2668d4bce1231ade4c38decefe355f
parent35535148a9f073886a42d6d3a32f70fa4767d9fd (diff)
downloadmail-b49b9959b5375ed44c94f968bcebb07a7b8eac94.tar.gz
prevent travis from building with features that are not available
-rw-r--r--.travis.yml4
-rw-r--r--Cargo.toml5
-rw-r--r--src/database.rs4
-rw-r--r--src/message.rs5
4 files changed, 13 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index 67e3a01..ab21b0a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,3 +9,7 @@ addons:
apt:
packages:
- libnotmuch-dev
+
+script:
+ - cargo build --no-default-features --verbose --all
+ - cargo test --no-default-features --verbose --all
diff --git a/Cargo.toml b/Cargo.toml
index d846862..401d553 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,6 +15,11 @@ travis-ci = { repository = "vhdirk/notmuch-rs" }
libc = "0.2"
clippy = { version = "0.0.193", optional = true }
+[features]
+v0_21 = []
+v0_26 = ["v0_21"]
+default = ["v0_26"]
+
[[test]]
name = "main"
diff --git a/src/database.rs b/src/database.rs
index 34fe4fd..a597b2d 100644
--- a/src/database.rs
+++ b/src/database.rs
@@ -1,7 +1,7 @@
use std::ops::Drop;
use std::ptr;
use std::path::Path;
-use std::ffi::CString;
+use std::ffi::{CStr, CString};
use libc;
@@ -124,7 +124,7 @@ impl Database {
})
}
- #[cfg(feature = "0.21")]
+ #[cfg(feature = "v0_21")]
pub fn revision(&self) -> Revision {
let uuid_p: *const libc::c_char = ptr::null();
let revision = unsafe {
diff --git a/src/message.rs b/src/message.rs
index c3b100f..d28257c 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -45,9 +45,8 @@ impl<'q, 'd> Message<'q, 'd>{
})
}
- #[cfg(feature = "0.26")]
- pub fn count_files(self: &Self) -> i32
- {
+ #[cfg(feature = "v0_26")]
+ pub fn count_files(self: &Self) -> i32{
unsafe {
ffi::notmuch_message_count_files(self.0)
}