Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
Signed-off-by: tabokie <xy.tao@outlook.com>
  • Loading branch information
tabokie committed Dec 21, 2020
1 parent 9656901 commit a7a9b5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions librocksdb_sys/crocksdb/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4162,15 +4162,15 @@ size_t crocksdb_file_system_inspector_read(
crocksdb_file_system_inspector_t* inspector, size_t len, char** errptr) {
assert(inspector != nullptr && inspector->rep != nullptr);
size_t allowed = 0;
SaveError(errptr, inspector->rep->Read(len, allowed));
SaveError(errptr, inspector->rep->Read(len, &allowed));
return allowed;
}

size_t crocksdb_file_system_inspector_write(
crocksdb_file_system_inspector_t* inspector, size_t len, char** errptr) {
assert(inspector != nullptr && inspector->rep != nullptr);
size_t allowed = 0;
SaveError(errptr, inspector->rep->Write(len, allowed));
SaveError(errptr, inspector->rep->Write(len, &allowed));
return allowed;
}

Expand Down
9 changes: 4 additions & 5 deletions src/file_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ impl Drop for DBFileSystemInspector {
impl FileSystemInspector for DBFileSystemInspector {
fn read(&self, len: usize) -> Result<usize, String> {
let ret = unsafe {
ffi_try!(crocksdb_ffi::crocksdb_file_system_inspector_read(
ffi_try!(crocksdb_file_system_inspector_read(
self.inner, len
))
};
Ok(ret)
}
fn write(&self, len: usize) -> Result<usize, String> {
let ret = unsafe {
ffi_try!(crocksdb_ffi::crocksdb_file_system_inspector_write(
ffi_try!(crocksdb_file_system_inspector_write(
self.inner, len
))
};
Expand All @@ -106,7 +106,6 @@ impl FileSystemInspector for DBFileSystemInspector {

#[cfg(test)]
mod test {
use std::io::{Error, ErrorKind};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};

Expand Down Expand Up @@ -147,7 +146,7 @@ mod test {
if len <= inner.refill_bytes {
Ok(len)
} else {
Err("request exceeds refill bytes");
Err("request exceeds refill bytes".into())
}
}
fn write(&self, len: usize) -> Result<usize, String> {
Expand All @@ -156,7 +155,7 @@ mod test {
if len <= inner.refill_bytes {
Ok(len)
} else {
Err("request exceeds refill bytes");
Err("request exceeds refill bytes".into())
}
}
}
Expand Down

0 comments on commit a7a9b5e

Please sign in to comment.