@@ -33,7 +33,11 @@ pub type DBRawIterator<'a> = DBRawIteratorWithThreadMode<'a, DB>;
33
33
/// ```
34
34
/// use rust_rocksdb::{DB, Options};
35
35
///
36
- /// let path = "_path_for_rocksdb_storage4";
36
+ /// let tempdir = tempfile::Builder::new()
37
+ /// .prefix("_path_for_rocksdb_storage4")
38
+ /// .tempdir()
39
+ /// .expect("Failed to create temporary path for the _path_for_rocksdb_storage4.");
40
+ /// let path = tempdir.path();
37
41
/// {
38
42
/// let db = DB::open_default(path).unwrap();
39
43
/// let mut iter = db.raw_iterator();
@@ -143,7 +147,11 @@ impl<'a, D: DBAccess> DBRawIteratorWithThreadMode<'a, D> {
143
147
/// ```rust
144
148
/// use rust_rocksdb::{DB, Options};
145
149
///
146
- /// let path = "_path_for_rocksdb_storage5";
150
+ /// let tempdir = tempfile::Builder::new()
151
+ /// .prefix("_path_for_rocksdb_storage5")
152
+ /// .tempdir()
153
+ /// .expect("Failed to create temporary path for the _path_for_rocksdb_storage5.");
154
+ /// let path = tempdir.path();
147
155
/// {
148
156
/// let db = DB::open_default(path).unwrap();
149
157
/// let mut iter = db.raw_iterator();
@@ -180,7 +188,11 @@ impl<'a, D: DBAccess> DBRawIteratorWithThreadMode<'a, D> {
180
188
/// ```rust
181
189
/// use rust_rocksdb::{DB, Options};
182
190
///
183
- /// let path = "_path_for_rocksdb_storage6";
191
+ /// let tempdir = tempfile::Builder::new()
192
+ /// .prefix("_path_for_rocksdb_storage6")
193
+ /// .tempdir()
194
+ /// .expect("Failed to create temporary path for the _path_for_rocksdb_storage6.");
195
+ /// let path = tempdir.path();
184
196
/// {
185
197
/// let db = DB::open_default(path).unwrap();
186
198
/// let mut iter = db.raw_iterator();
@@ -220,7 +232,11 @@ impl<'a, D: DBAccess> DBRawIteratorWithThreadMode<'a, D> {
220
232
/// ```rust
221
233
/// use rust_rocksdb::{DB, Options};
222
234
///
223
- /// let path = "_path_for_rocksdb_storage7";
235
+ /// let tempdir = tempfile::Builder::new()
236
+ /// .prefix("_path_for_rocksdb_storage7")
237
+ /// .tempdir()
238
+ /// .expect("Failed to create temporary path for the _path_for_rocksdb_storage7.");
239
+ /// let path = tempdir.path();
224
240
/// {
225
241
/// let db = DB::open_default(path).unwrap();
226
242
/// let mut iter = db.raw_iterator();
@@ -259,7 +275,11 @@ impl<'a, D: DBAccess> DBRawIteratorWithThreadMode<'a, D> {
259
275
/// ```rust
260
276
/// use rust_rocksdb::{DB, Options};
261
277
///
262
- /// let path = "_path_for_rocksdb_storage8";
278
+ /// let tempdir = tempfile::Builder::new()
279
+ /// .prefix("_path_for_rocksdb_storage8")
280
+ /// .tempdir()
281
+ /// .expect("Failed to create temporary path for the _path_for_rocksdb_storage8.");
282
+ /// let path = tempdir.path();
263
283
/// {
264
284
/// let db = DB::open_default(path).unwrap();
265
285
/// let mut iter = db.raw_iterator();
@@ -377,7 +397,11 @@ pub type DBIterator<'a> = DBIteratorWithThreadMode<'a, DB>;
377
397
/// ```
378
398
/// use rust_rocksdb::{DB, Direction, IteratorMode, Options};
379
399
///
380
- /// let path = "_path_for_rocksdb_storage2";
400
+ /// let tempdir = tempfile::Builder::new()
401
+ /// .prefix("_path_for_rocksdb_storage2")
402
+ /// .tempdir()
403
+ /// .expect("Failed to create temporary path for the _path_for_rocksdb_storage2.");
404
+ /// let path = tempdir.path();
381
405
/// {
382
406
/// let db = DB::open_default(path).unwrap();
383
407
/// let mut iter = db.iterator(IteratorMode::Start); // Always iterates forward
0 commit comments