Skip to content

DB::repair: pass Options by ref#350

Merged
aleksuss merged 1 commit into
rust-rocksdb:masterfrom
ordian:pass-option-as-ref
Nov 12, 2019
Merged

DB::repair: pass Options by ref#350
aleksuss merged 1 commit into
rust-rocksdb:masterfrom
ordian:pass-option-as-ref

Conversation

@ordian

@ordian ordian commented Nov 9, 2019

Copy link
Copy Markdown

This is a breaking change.

@ordian

ordian commented Nov 9, 2019

Copy link
Copy Markdown
Author

CI failure seems spurious.

Comment thread src/db.rs
Ok(())
}

pub fn repair<P: AsRef<Path>>(opts: Options, path: P) -> Result<(), Error> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a point ? Do we need to use Options after repairing ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's exactly what we do:

let db_corrupted = Path::new(path).join(Database::CORRUPTION_FILE_NAME);
if db_corrupted.exists() {
	DB::repair(&opts, path)?;
	//         ^^^^^
}
// ...
DB::open_cf(&opts, path, &cfnames)

@vitvakatu

Copy link
Copy Markdown

No reason not to accept something via ref if it's possible.

@aleksuss aleksuss merged commit 52ebdb5 into rust-rocksdb:master Nov 12, 2019
@ordian ordian deleted the pass-option-as-ref branch November 12, 2019 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants