From 2a517f437a3f1a6c08e64fc9c89fc0ffa0cd0868 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sun, 17 Mar 2024 09:43:31 +0100 Subject: [PATCH] config: fix toml move-to-workspace action --- toml-config/src/config.rs | 1 + toml-config/src/config/parsers/action.rs | 2 +- toml-config/src/lib.rs | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/toml-config/src/config.rs b/toml-config/src/config.rs index 8fb5023b..d56817a2 100644 --- a/toml-config/src/config.rs +++ b/toml-config/src/config.rs @@ -60,6 +60,7 @@ pub enum Action { ConfigureInput { input: Input }, ConfigureOutput { out: Output }, Exec { exec: Exec }, + MoveToWorkspace { name: String }, Multi { actions: Vec }, SetEnv { env: Vec<(String, String)> }, SetGfxApi { api: GfxApi }, diff --git a/toml-config/src/config/parsers/action.rs b/toml-config/src/config/parsers/action.rs index b697f82e..4c5f4d2a 100644 --- a/toml-config/src/config/parsers/action.rs +++ b/toml-config/src/config/parsers/action.rs @@ -133,7 +133,7 @@ impl ActionParser<'_> { fn parse_move_to_workspace(&mut self, ext: &mut Extractor<'_>) -> ParseResult { let name = ext.extract(str("name"))?.value.to_string(); - Ok(Action::ShowWorkspace { name }) + Ok(Action::MoveToWorkspace { name }) } fn parse_configure_connector(&mut self, ext: &mut Extractor<'_>) -> ParseResult { diff --git a/toml-config/src/lib.rs b/toml-config/src/lib.rs index a3ba4adb..c3fffb05 100644 --- a/toml-config/src/lib.rs +++ b/toml-config/src/lib.rs @@ -75,6 +75,10 @@ impl Action { let workspace = get_workspace(&name); Box::new(move || s.show_workspace(workspace)) } + Action::MoveToWorkspace { name } => { + let workspace = get_workspace(&name); + Box::new(move || s.set_workspace(workspace)) + } Action::ConfigureConnector { con } => Box::new(move || { for c in connectors() { if con.match_.matches(c) {