-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store: refactor StoreOpener; add Store::opener and related changes (#…
…7015) Firstly, replace StoreOpener constructors with static methods on the Store struct. Specifically, add Store::opener (which acts just like StoreOpener::new which is now private) and Store::tmp_opener (which replaces StoreOpener::with_default_config). Secondly, incorporate creation of the temporary directory into the Store::tmp_opener method. Previously, test code would create a temporary directory and use StoreOpener::with_default_config. Now, this is all rolled into single Store::tmp_opener method. The motivation for that is to make it painfully obvious that Store::tmp_opener is meant for tests only. Anything that operates on a non-temporary storage will have to use Store::opener and provide it with a StoreConfig. Lastly, change StoreOpener to resolve the path to the storage during construction. This replaces `home_dir` that the struct was holding with a `path: PathBuf`. This means that StoreOpener::get_path will no longer resolve the path on each call and have its return value ready to go. Issue: #6857
- Loading branch information
Showing
17 changed files
with
116 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.