summaryrefslogtreecommitdiff
path: root/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'src/types')
-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"])