mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-26 15:46:28 +00:00
Remove Project::load_from_str in favor of from_slice
This commit is contained in:
@@ -360,7 +360,7 @@ impl Project {
|
|||||||
.expect("Path had invalid Unicode")
|
.expect("Path had invalid Unicode")
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut project = Project::load_from_str(DEFAULT_PLACE, &project_path)
|
let mut project = Project::load_from_slice(DEFAULT_PLACE.as_bytes(), &project_path)
|
||||||
.map_err(ProjectInitError::JsonError)?;
|
.map_err(ProjectInitError::JsonError)?;
|
||||||
|
|
||||||
project.name = project_name.to_owned();
|
project.name = project_name.to_owned();
|
||||||
@@ -461,15 +461,6 @@ impl Project {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_from_str(
|
|
||||||
contents: &str,
|
|
||||||
project_file_location: &Path,
|
|
||||||
) -> Result<Project, serde_json::Error> {
|
|
||||||
let parsed: SourceProject = serde_json::from_str(&contents)?;
|
|
||||||
|
|
||||||
Ok(parsed.into_project(project_file_location))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn load_from_slice(
|
pub fn load_from_slice(
|
||||||
contents: &[u8],
|
contents: &[u8],
|
||||||
project_file_location: &Path,
|
project_file_location: &Path,
|
||||||
|
|||||||
Reference in New Issue
Block a user