Commit 3287c196 authored by Tyler Neely's avatar Tyler Neely

update readme to include delete

parent 6dbde9d2
...@@ -22,9 +22,10 @@ fn main() { ...@@ -22,9 +22,10 @@ fn main() {
println!("retrieved utf8 value {}", v), println!("retrieved utf8 value {}", v),
None => None =>
println!("did not read valid utf-8 out of the db"), println!("did not read valid utf-8 out of the db"),
}}); }
}).on_absent(|| { println!("value not found") });
db.get(b"NOT my key").on_absent( || { println!("value not found") }); db.delete(b"my key");
db.close(); db.close();
}, },
......
...@@ -7,8 +7,6 @@ use test::Bencher; ...@@ -7,8 +7,6 @@ use test::Bencher;
fn main() { fn main() {
match rocksdb::create_or_open("/tmp/rust-rocksdb".to_string()) { match rocksdb::create_or_open("/tmp/rust-rocksdb".to_string()) {
Ok(db) => { Ok(db) => {
for i in range(0u, 20) {
spawn(proc() {
db.put(b"my key", b"my value"); db.put(b"my key", b"my value");
db.get(b"my key").map( |value| { db.get(b"my key").map( |value| {
...@@ -17,13 +15,12 @@ fn main() { ...@@ -17,13 +15,12 @@ fn main() {
println!("retrieved utf8 value {}", v), println!("retrieved utf8 value {}", v),
None => None =>
println!("did not read valid utf-8 out of the db"), println!("did not read valid utf-8 out of the db"),
}}); }
}).on_absent(|| { println!("value not found") });
db.get(b"NOT my key").on_absent(|| { println!("value not found") }); db.delete(b"my key");
db.close(); db.close();
});
}
}, },
Err(e) => panic!(e), Err(e) => panic!(e),
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment