summaryrefslogtreecommitdiff
path: root/src/types/project.rs
diff options
context:
space:
mode:
authorPolesznyák Márk László <116908301+pml68@users.noreply.github.com>2025-03-23 02:49:57 +0100
committerGitHub <noreply@github.com>2025-03-23 02:49:57 +0100
commit3076889c00116b22f022792471253e7188c6e93e (patch)
treebff0cda7a9152e9f94d3176bbf5acaf879394f5f /src/types/project.rs
parentfeat: update to Rust 2024 (diff)
parentfeat: finish `ApplyOptions` impls (diff)
downloadiced-builder-3076889c00116b22f022792471253e7188c6e93e.tar.gz
Merge pull request #7 from pml68/feat/options-backend
Options backend done (for now)
Diffstat (limited to 'src/types/project.rs')
-rw-r--r--src/types/project.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/types/project.rs b/src/types/project.rs
index e665d5e..721783e 100644
--- a/src/types/project.rs
+++ b/src/types/project.rs
@@ -1,4 +1,5 @@
use std::path::{Path, PathBuf};
+use std::sync::Arc;
extern crate fxhash;
use fxhash::FxHashMap;
@@ -58,7 +59,7 @@ impl Project {
pub async fn from_path(
path: PathBuf,
- config: Config,
+ config: Arc<Config>,
) -> Result<(PathBuf, Self), Error> {
let contents = tokio::fs::read_to_string(&path).await?;
let mut project: Self = serde_json::from_str(&contents)?;
@@ -68,7 +69,9 @@ impl Project {
Ok((path, project))
}
- pub async fn from_file(config: Config) -> Result<(PathBuf, Self), Error> {
+ pub async fn from_file(
+ config: Arc<Config>,
+ ) -> Result<(PathBuf, Self), Error> {
let picked_file = rfd::AsyncFileDialog::new()
.set_title("Open a JSON file...")
.add_filter("*.json, *.JSON", &["json", "JSON"])