-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Moved --export to a seperate export command #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Left an optional suggestion, but not important.
pub(crate) fn export_account(path: Option<String>, account_index: usize) -> Result<()> { | ||
let wallet_path = match &path { | ||
Some(path) => PathBuf::from(path), | ||
None => home::home_dir().unwrap().join(DEFAULT_WALLETS_VAULT_PATH), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this path gets used quite a bit, perhaps we could have some default_home_wallets_vault_path
function for it or similar?
A more idiomatic approach to retrieving the wallet_path
might look like:
let wallet_path = path
.map(PathBuf::from)
.unwrap_or_else(default_home_wallets_vault_path);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this looks much better thanks! Since I have couple of wallet path usage I am thinking of cleaning all of them together with a future PR if that sounds good to you.
Created #49 to track that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
closes #43