diff --git a/src/lib.rs b/src/lib.rs index 3c03fef..4dfd068 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,7 +50,6 @@ //! } //! } //! ``` -#![cfg_attr(test, feature(duration))] extern crate libc; extern crate libsqlite3_sys as ffi; #[macro_use] extern crate bitflags; diff --git a/src/trace.rs b/src/trace.rs index cde1d75..de03742 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -80,19 +80,17 @@ mod test { super::config_log(None).unwrap(); } - extern "C" fn profile_callback(_: *mut ::libc::c_void, sql: *const ::libc::c_char, nanoseconds: u64) { - use std::time::Duration; + extern "C" fn trace_callback(_: *mut ::libc::c_void, sql: *const ::libc::c_char) { unsafe { let c_slice = ::std::ffi::CStr::from_ptr(sql).to_bytes(); - let d = Duration::from_millis(nanoseconds / 1_000_000); - let _ = writeln!(::std::io::stderr(), "PROFILE: {:?} ({})", ::std::str::from_utf8(c_slice), d); + let _ = writeln!(::std::io::stderr(), "TRACE: {:?}", ::std::str::from_utf8(c_slice)); } } #[test] - fn test_profile() { + fn test_trace() { let mut db = SqliteConnection::open_in_memory().unwrap(); - db.profile(Some(profile_callback)); + db.trace(Some(trace_callback)); db.execute_batch("PRAGMA application_id = 1").unwrap(); } } \ No newline at end of file