Skip to content

Commit 6432990

Browse files
committed
fix ci error about test_event_listener_basic
Signed-off-by: fredchenbj <[email protected]>
1 parent 133b975 commit 6432990

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

librocksdb_sys/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ pub struct DBWriteStallInfo(c_void);
151151
pub struct DBStatusPtr(c_void);
152152
#[repr(C)]
153153
pub struct DBMapProperty(c_void);
154+
#[repr(C)]
155+
pub struct DBCompactionReason(c_void);
154156

155157
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
156158
#[repr(C)]
@@ -1774,7 +1776,7 @@ extern "C" {
17741776
pub fn crocksdb_compactionjobinfo_total_output_bytes(info: *const DBCompactionJobInfo) -> u64;
17751777
pub fn crocksdb_compactionjobinfo_compaction_reason(
17761778
info: *const DBCompactionJobInfo,
1777-
) -> CompactionReason;
1779+
) -> *const DBCompactionReason;
17781780

17791781
pub fn crocksdb_externalfileingestioninfo_cf_name(
17801782
info: *const DBIngestionInfo,

src/event_listener.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ impl CompactionJobInfo {
126126
}
127127

128128
pub fn compaction_reason(&self) -> CompactionReason {
129-
unsafe { crocksdb_ffi::crocksdb_compactionjobinfo_compaction_reason(&self.0) }
129+
unsafe {
130+
*(crocksdb_ffi::crocksdb_compactionjobinfo_compaction_reason(&self.0)
131+
as *const CompactionReason)
132+
}
130133
}
131134
}
132135

0 commit comments

Comments
 (0)