From a31345da43907c9d3143bb69dae1c4e7b93b61d7 Mon Sep 17 00:00:00 2001 From: Ivan Ukhov Date: Fri, 12 Jun 2015 15:01:12 -0400 Subject: [PATCH] Introduce the edge feature for backward compatibility --- Cargo.toml | 5 ++++- src/database.rs | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index adab821..8251b95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sqlite" -version = "0.10.0" +version = "0.11.0" authors = ["Ivan Ukhov "] license = "MIT" repository = "https://github.com/stainless-steel/sqlite" @@ -8,6 +8,9 @@ homepage = "https://github.com/stainless-steel/sqlite" documentation = "https://stainless-steel.github.io/sqlite" description = "The package provides an interface to SQLite." +[features] +edge = ["sqlite3-sys/edge"] + [dependencies] libc = "*" sqlite3-sys = "*" diff --git a/src/database.rs b/src/database.rs index 77b363e..f03f6cb 100644 --- a/src/database.rs +++ b/src/database.rs @@ -99,6 +99,15 @@ impl<'l> Database<'l> { } impl<'l> Drop for Database<'l> { + #[cfg(not(feature = "edge"))] + #[inline] + #[allow(unused_must_use)] + fn drop(&mut self) { + self.remove_busy_handler(); + unsafe { ffi::sqlite3_close(self.raw) }; + } + + #[cfg(feature = "edge")] #[inline] #[allow(unused_must_use)] fn drop(&mut self) {