diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-26 22:00:20 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-26 22:00:20 +0100 |
commit | 31b439ee313c9268ac338dd130390d4f7200e693 (patch) | |
tree | 75b3905deacdd849d5fb4fab7e28ed3bf366151b /planetwars-cli/src/web/mod.rs | |
parent | 0d03a0fbc214dd3fb9a8af562f9d88cccaf5f2c0 (diff) | |
download | planetwars.dev-31b439ee313c9268ac338dd130390d4f7200e693.tar.xz planetwars.dev-31b439ee313c9268ac338dd130390d4f7200e693.zip |
rebrand project to workspace
Diffstat (limited to 'planetwars-cli/src/web/mod.rs')
-rw-r--r-- | planetwars-cli/src/web/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/planetwars-cli/src/web/mod.rs b/planetwars-cli/src/web/mod.rs index cd94f5e..66d4218 100644 --- a/planetwars-cli/src/web/mod.rs +++ b/planetwars-cli/src/web/mod.rs @@ -21,17 +21,17 @@ use std::{ use crate::match_runner::MatchMeta; struct State { - project_root: PathBuf, + workspace_root: PathBuf, } impl State { - fn new(project_root: PathBuf) -> Self { - Self { project_root } + fn new(workspace_root: PathBuf) -> Self { + Self { workspace_root } } } -pub async fn run(project_root: PathBuf) { - let shared_state = Arc::new(State::new(project_root)); +pub async fn run(workspace_root: PathBuf) { + let shared_state = Arc::new(State::new(workspace_root)); // build our application with a route let app = Router::new() @@ -59,7 +59,7 @@ struct MatchData { async fn list_matches(Extension(state): Extension<Arc<State>>) -> Json<Vec<MatchData>> { let matches = state - .project_root + .workspace_root .join("matches") .read_dir() .unwrap() @@ -104,7 +104,7 @@ fn read_match_meta(path: &path::Path) -> io::Result<MatchMeta> { } async fn get_match(Extension(state): Extension<Arc<State>>, Path(id): Path<String>) -> String { - let mut match_path = state.project_root.join("matches").join(id); + let mut match_path = state.workspace_root.join("matches").join(id); match_path.set_extension("log"); fs::read_to_string(match_path).unwrap() } |