MCPcopy Create free account
hub / github.com/CleanCut/ultimate_rust2 / main

Function main

example/puzzle_game/src/main.rs:13–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11}
12
13fn main() -> Result<()> {
14 env_logger::init();
15 // This gets the absolute path to the puzzle.dat file in examples/puzzle_game no matter what
16 // directory you are in when you run the `cargo run` command.
17 let puzzle_file_path = &format!("{}/{}", env!("CARGO_MANIFEST_DIR"), "puzzle.dat");
18 let puzzle = match get_puzzle(puzzle_file_path).context("Couldn't get the first puzzle") {
19 Ok(p) => p,
20 Err(_) => Puzzle::new(),
21 };
22 info!("Playing puzzle: {}", puzzle.name);
23 Ok(())
24}

Callers

nothing calls this directly

Calls 1

get_puzzleFunction · 0.85

Tested by

no test coverage detected