diff options
| author | C. Morgan Hamill <me@cmhamill.org> | 2015-03-20 16:35:00 +0100 |
|---|---|---|
| committer | C. Morgan Hamill <me@cmhamill.org> | 2015-03-20 16:35:00 +0100 |
| commit | 98cba2aa2f2aea029ef498560658d862284db6ca (patch) | |
| tree | f462b5a13d81f2e479fa00618f17843855f7fb8d | |
| parent | de63975fbe66607f8a1ad0ac8332a6bca15d3a01 (diff) | |
| download | mail-98cba2aa2f2aea029ef498560658d862284db6ca.tar.gz | |
Implement `Drop` for `Database`.
Simple wrapper around notmuch API's `notmuch_database_destroy()`
function.
| -rw-r--r-- | src/database.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/database.rs b/src/database.rs index 7364942..3955865 100644 --- a/src/database.rs +++ b/src/database.rs @@ -1,4 +1,5 @@ use std::{ + ops, path, ptr, }; @@ -90,5 +91,12 @@ impl Database { Ok(()) } +} +impl ops::Drop for Database { + fn drop(&mut self) { + unsafe { + ffi::notmuch_database_destroy(self.0) + }; + } } |
