Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
3048f8fd
Commit
3048f8fd
authored
Mar 03, 2016
by
Tyler Neely
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #50 from ngaut/ngaut/tiny-clean-up
*: Tiny clean up.
parents
d1966b42
3916a067
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
26 deletions
+3
-26
comparator.rs
src/comparator.rs
+0
-24
merge_operator.rs
src/merge_operator.rs
+2
-0
rocksdb.rs
src/rocksdb.rs
+1
-2
No files found.
src/comparator.rs
View file @
3048f8fd
...
@@ -53,27 +53,3 @@ pub extern "C" fn compare_callback(raw_cb: *mut c_void,
...
@@ -53,27 +53,3 @@ pub extern "C" fn compare_callback(raw_cb: *mut c_void,
(
cb
.f
)(
a
,
b
)
(
cb
.f
)(
a
,
b
)
}
}
}
}
fn
test_reverse_compare
(
a
:
&
[
u8
],
b
:
&
[
u8
])
->
c_int
{
if
a
<
b
{
1
}
else
if
a
>
b
{
-
1
}
else
{
0
}
}
// #[allow(dead_code)]
// #[test]
// fn compare_works() {
// let path = "_rust_rocksdb_comparetest";
// let mut opts = Options::new();
// opts.create_if_missing(true);
// opts.add_comparator("test comparator", test_reverse_compare);
// {
// let db = DB::open(&opts, path).unwrap();
// // TODO add interesting test
// }
// assert!(DB::destroy(&opts, path).is_ok());
// }
src/merge_operator.rs
View file @
3048f8fd
...
@@ -152,6 +152,8 @@ impl<'a> Iterator for &'a mut MergeOperands {
...
@@ -152,6 +152,8 @@ impl<'a> Iterator for &'a mut MergeOperands {
}
}
}
}
#[allow(unused_variables)]
#[allow(dead_code)]
fn
test_provided_merge
(
new_key
:
&
[
u8
],
fn
test_provided_merge
(
new_key
:
&
[
u8
],
existing_val
:
Option
<&
[
u8
]
>
,
existing_val
:
Option
<&
[
u8
]
>
,
operands
:
&
mut
MergeOperands
)
operands
:
&
mut
MergeOperands
)
...
...
src/rocksdb.rs
View file @
3048f8fd
...
@@ -818,6 +818,7 @@ impl ReadOptions {
...
@@ -818,6 +818,7 @@ impl ReadOptions {
// TODO add snapshot setting here
// TODO add snapshot setting here
// TODO add snapshot wrapper structs with proper destructors;
// TODO add snapshot wrapper structs with proper destructors;
// that struct needs an "iterator" impl too.
// that struct needs an "iterator" impl too.
#[allow(dead_code)]
fn
fill_cache
(
&
mut
self
,
v
:
bool
)
{
fn
fill_cache
(
&
mut
self
,
v
:
bool
)
{
unsafe
{
unsafe
{
rocksdb_ffi
::
rocksdb_readoptions_set_fill_cache
(
self
.inner
,
v
);
rocksdb_ffi
::
rocksdb_readoptions_set_fill_cache
(
self
.inner
,
v
);
...
@@ -854,13 +855,11 @@ impl Drop for DBVector {
...
@@ -854,13 +855,11 @@ impl Drop for DBVector {
impl
DBVector
{
impl
DBVector
{
pub
fn
from_c
(
val
:
*
mut
u8
,
val_len
:
size_t
)
->
DBVector
{
pub
fn
from_c
(
val
:
*
mut
u8
,
val_len
:
size_t
)
->
DBVector
{
unsafe
{
DBVector
{
DBVector
{
base
:
val
,
base
:
val
,
len
:
val_len
as
usize
,
len
:
val_len
as
usize
,
}
}
}
}
}
pub
fn
to_utf8
<
'a
>
(
&
'a
self
)
->
Option
<&
'a
str
>
{
pub
fn
to_utf8
<
'a
>
(
&
'a
self
)
->
Option
<&
'a
str
>
{
from_utf8
(
self
.deref
())
.ok
()
from_utf8
(
self
.deref
())
.ok
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment