MCPcopy Create free account
hub / github.com/17cupsofcoffee/nova / from_file

Method from_file

src/ldtk.rs:14–17  ·  view source on GitHub ↗
(path: impl AsRef<Path>)

Source from the content-addressed store, hash-verified

12
13impl Project {
14 pub fn from_file(path: impl AsRef<Path>) -> Project {
15 let json = std::fs::read_to_string(path).unwrap();
16 serde_json::from_str(&json).unwrap()
17 }
18
19 pub fn get_level(&self, id: &str) -> Option<&Level> {
20 self.levels.iter().find(|l| l.identifier == id)

Callers

nothing calls this directly

Calls 1

read_to_stringFunction · 0.85

Tested by

no test coverage detected