mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-26 17:15:52 +00:00
Simplify Model::from_path
This commit is contained in:
parent
bf5c31f463
commit
f094ce41d9
@ -53,10 +53,11 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
let args = Args::parse();
|
||||
let config = Config::load()?;
|
||||
let model = Model::from_path(
|
||||
config.default_path,
|
||||
args.model.unwrap_or(config.default_model),
|
||||
);
|
||||
|
||||
let mut path = config.default_path;
|
||||
path.push(args.model.unwrap_or(config.default_model));
|
||||
|
||||
let model = Model::from_path(path);
|
||||
|
||||
let mut parameters = HashMap::new();
|
||||
for parameter in args.parameters {
|
||||
|
@ -12,10 +12,7 @@ pub struct Model {
|
||||
}
|
||||
|
||||
impl Model {
|
||||
pub fn from_path(base_path: PathBuf, rel_path: PathBuf) -> Self {
|
||||
let mut path = base_path;
|
||||
path.push(rel_path);
|
||||
|
||||
pub fn from_path(path: PathBuf) -> Self {
|
||||
Self { path }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user