From 76f649640607ffb5e727f59e442ffabef240f09c Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Sat, 29 Oct 2016 21:06:30 -0700 Subject: Implement Drop for Diagnostic --- src/clang.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/clang.rs b/src/clang.rs index c0934055..8e1ec258 100755 --- a/src/clang.rs +++ b/src/clang.rs @@ -1042,9 +1042,11 @@ impl Diagnostic { clang_getDiagnosticSeverity(self.x) } } +} +impl Drop for Diagnostic { /// Destroy this diagnostic message. - pub fn dispose(&self) { + fn drop(&mut self) { unsafe { clang_disposeDiagnostic(self.x); } -- cgit v1.2.3