README spacing

master
Tyler Neely 10 years ago
parent e1142f4f2f
commit 4e88723519
  1. 30
      README.md

@ -12,24 +12,24 @@ git = "https://github.com/spacejam/rust-rocksdb"
extern crate rocksdb; extern crate rocksdb;
fn main() { fn main() {
match rocksdb::create_or_open("/path/for/rocksdb/storage".to_string()) { match rocksdb::create_or_open("/path/for/rocksdb/storage".to_string()) {
Ok(db) => { Ok(db) => {
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| {
match value.to_utf8() { match value.to_utf8() {
Some(v) => Some(v) =>
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"),
}}); }});
db.get(b"NOT my key").on_absent(|| { println!("value not found") }); db.get(b"NOT my key").on_absent(|| { println!("value not found") });
db.close(); db.close();
}, },
Err(e) => panic!(e), Err(e) => panic!(e),
} }
} }
``` ```

Loading…
Cancel
Save