use relative path for tests

master
Tyler Neely 8 years ago
parent 5407d06f4c
commit e9c843a1d4
  1. 1
      .gitignore
  2. 6
      src/lib.rs
  3. 2
      src/merge_operator.rs
  4. 6
      src/rocksdb.rs

1
.gitignore vendored

@ -7,3 +7,4 @@ Cargo.lock
_rust_rocksdb*
*rlib
tags
path

@ -20,7 +20,7 @@
//! ```
//! use rocksdb::DB;
//! // NB: db is automatically closed at end of lifetime
//! let db = DB::open_default("/path/for/rocksdb/storage").unwrap();
//! let db = DB::open_default("path/for/rocksdb/storage").unwrap();
//! db.put(b"my key", b"my value");
//! match db.get(b"my key") {
//! Ok(Some(value)) => println!("retrieved value {}", value.to_utf8().unwrap()),
@ -63,7 +63,7 @@ pub struct BlockBasedOptions {
/// use rocksdb::DBCompactionStyle;
///
/// fn badly_tuned_for_somebody_elses_disk() -> DB {
/// let path = "/path/for/rocksdb/storage5";
/// let path = "path/for/rocksdb/storage5";
/// let mut opts = Options::default();
/// opts.create_if_missing(true);
/// opts.set_max_open_files(10000);
@ -99,7 +99,7 @@ pub struct Options {
/// ```
/// use rocksdb::{DB, WriteBatch, WriteOptions};
///
/// let db = DB::open_default("/path/for/rocksdb/storage6").unwrap();
/// let db = DB::open_default("path/for/rocksdb/storage6").unwrap();
///
/// let mut batch = WriteBatch::default();
/// batch.put(b"my key", b"my value");

@ -38,7 +38,7 @@
//! }
//!
//! fn main() {
//! let path = "/path/to/rocksdb";
//! let path = "path/to/rocksdb";
//! let mut opts = Options::default();
//! opts.create_if_missing(true);
//! opts.add_merge_operator("test operator", concat_merge);

@ -78,7 +78,7 @@ pub enum DBRecoveryMode {
/// ```
/// use rocksdb::{DB, WriteBatch};
///
/// let db = DB::open_default("/path/for/rocksdb/storage1").unwrap();
/// let db = DB::open_default("path/for/rocksdb/storage1").unwrap();
/// {
/// let mut batch = WriteBatch::default();
/// batch.put(b"my key", b"my value");
@ -100,7 +100,7 @@ pub struct ReadOptions {
/// ```
/// use rocksdb::{DB, IteratorMode};
///
/// let db = DB::open_default("/path/for/rocksdb/storage3").unwrap();
/// let db = DB::open_default("path/for/rocksdb/storage3").unwrap();
/// let snapshot = db.snapshot(); // Creates a longer-term snapshot of the DB, but closed when goes out of scope
/// let mut iter = snapshot.iterator(IteratorMode::Start); // Make as many iterators as you'd like from one snapshot
/// ```
@ -116,7 +116,7 @@ pub struct Snapshot<'a> {
/// ```
/// use rocksdb::{DB, Direction, IteratorMode};
///
/// let mut db = DB::open_default("/path/for/rocksdb/storage2").unwrap();
/// let mut db = DB::open_default("path/for/rocksdb/storage2").unwrap();
/// let mut iter = db.iterator(IteratorMode::Start); // Always iterates forward
/// for (key, value) in iter {
/// println!("Saw {:?} {:?}", key, value);

Loading…
Cancel
Save