Skip to content

Commit

Permalink
update new_from_char method name
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Mar 5, 2020
1 parent cb3e085 commit 6e966f6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/database/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<K: Key> Batch<K> for Database<K> {
if error == ptr::null_mut() {
Ok(())
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/database/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Error {
///
/// This method is `unsafe` because the pointer must be valid and point to heap.
/// The pointer will be passed to `free`!
pub unsafe fn new_from_c_char(message: *const c_char) -> Error {
pub unsafe fn new_from_char(message: *const c_char) -> Error {
use std::str::from_utf8;
use std::ffi::CStr;

Expand Down
6 changes: 3 additions & 3 deletions src/database/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<K: Key> KV<K> for Database<K> {
if error == ptr::null_mut() {
Ok(())
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
})
}
Expand All @@ -96,7 +96,7 @@ impl<K: Key> KV<K> for Database<K> {
if error == ptr::null_mut() {
Ok(())
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
})
}
Expand All @@ -119,7 +119,7 @@ impl<K: Key> KV<K> for Database<K> {
if error == ptr::null_mut() {
Ok(Bytes::from_raw(result as *mut u8, length))
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/database/management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn destroy(name: &Path, options: Options) -> Result<(), Error> {
if error == ptr::null_mut() {
Ok(())
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
}
}
Expand All @@ -39,7 +39,7 @@ pub fn repair(name: &Path, options: Options) -> Result<(), Error> {
if error == ptr::null_mut() {
Ok(())
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
}
}
4 changes: 2 additions & 2 deletions src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<K: Key> Database<K> {
if error == ptr::null_mut() {
Ok(Database::new(db, options, None))
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
}
}
Expand Down Expand Up @@ -148,7 +148,7 @@ impl<K: Key> Database<K> {
if error == ptr::null_mut() {
Ok(Database::new(db, options, Some(comp_ptr)))
} else {
Err(Error::new_from_c_char(error))
Err(Error::new_from_char(error))
}
}
}
Expand Down

0 comments on commit 6e966f6

Please sign in to comment.