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 args = Args::parse();
|
||||||
let config = Config::load()?;
|
let config = Config::load()?;
|
||||||
let model = Model::from_path(
|
|
||||||
config.default_path,
|
let mut path = config.default_path;
|
||||||
args.model.unwrap_or(config.default_model),
|
path.push(args.model.unwrap_or(config.default_model));
|
||||||
);
|
|
||||||
|
let model = Model::from_path(path);
|
||||||
|
|
||||||
let mut parameters = HashMap::new();
|
let mut parameters = HashMap::new();
|
||||||
for parameter in args.parameters {
|
for parameter in args.parameters {
|
||||||
|
@ -12,10 +12,7 @@ pub struct Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Model {
|
impl Model {
|
||||||
pub fn from_path(base_path: PathBuf, rel_path: PathBuf) -> Self {
|
pub fn from_path(path: PathBuf) -> Self {
|
||||||
let mut path = base_path;
|
|
||||||
path.push(rel_path);
|
|
||||||
|
|
||||||
Self { path }
|
Self { path }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user