From dacc05a41b77bf2e86e27ac354db9b047c661a7d Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 28 Dec 2021 14:57:41 +0100 Subject: refactor workspace code --- planetwars-cli/src/commands/serve.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'planetwars-cli/src/commands/serve.rs') diff --git a/planetwars-cli/src/commands/serve.rs b/planetwars-cli/src/commands/serve.rs index a078c83..aa8d149 100644 --- a/planetwars-cli/src/commands/serve.rs +++ b/planetwars-cli/src/commands/serve.rs @@ -1,18 +1,17 @@ -use std::env; use std::io; use clap::Parser; use crate::web; +use crate::workspace::Workspace; #[derive(Parser)] pub struct ServeCommand; impl ServeCommand { pub async fn run(self) -> io::Result<()> { - let workspace_root = env::current_dir().unwrap(); - - web::run(workspace_root).await; + let workspace = Workspace::open_current_dir()?; + web::run(workspace).await; Ok(()) } } -- cgit v1.2.3