From e9c843a1d4d04c6f7124222f2a9016bff517cc83 Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Sun, 13 Nov 2016 20:18:43 +0100 Subject: [PATCH] use relative path for tests --- .gitignore | 1 + src/lib.rs | 6 +++--- src/merge_operator.rs | 2 +- src/rocksdb.rs | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index aabca7b..1fc9772 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ Cargo.lock _rust_rocksdb* *rlib tags +path diff --git a/src/lib.rs b/src/lib.rs index 30f6f18..0854799 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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"); diff --git a/src/merge_operator.rs b/src/merge_operator.rs index 8d36f87..8980ee0 100644 --- a/src/merge_operator.rs +++ b/src/merge_operator.rs @@ -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); diff --git a/src/rocksdb.rs b/src/rocksdb.rs index b4f735e..4070ecb 100644 --- a/src/rocksdb.rs +++ b/src/rocksdb.rs @@ -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);