-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
In the docs, I find
use etcetera::{choose_app_strategy, AppStrategy, AppStrategyArgs};
let strategy = choose_app_strategy(AppStrategyArgs {
top_level_domain: "org".to_string(),
author: "Acme Corp".to_string(),
app_name: "Frobnicator Plus".to_string(),
}).unwrap();
let config_dir = strategy.config_dir();Now, I'd like to get different dirs in different parts of my code. To this end, I'd like to define the strategy once somewhere in my code and then draw from it. Is this
use etcetera::{AppStrategy, AppStrategyArgs, choose_app_strategy};
pub fn get_dirs() -> impl AppStrategy {
choose_app_strategy(AppStrategyArgs {
top_level_domain: "com".to_string(),
author: "YourName".to_string(),
app_name: "MyApp".to_string(),
})
.expect("Failed to create app strategy")
}the recommended way of doing it? Perhaps it's a little overkill to re-choose the strategy over and over again.
Metadata
Metadata
Assignees
Labels
No labels