From 821ada0b8c3ffef3d4286f3c4fc15871ff9b5f65 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 3 Jun 2026 18:26:23 +0200 Subject: pkgs/tskm: Update `taskchampion` to 3.x --- pkgs/by-name/ts/tskm/src/interface/open/handle.rs | 38 +++++++++++++++-------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'pkgs/by-name/ts/tskm/src/interface/open') diff --git a/pkgs/by-name/ts/tskm/src/interface/open/handle.rs b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs index 15f749c5..5b9100bc 100644 --- a/pkgs/by-name/ts/tskm/src/interface/open/handle.rs +++ b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs @@ -10,7 +10,7 @@ use std::str::FromStr; -use anyhow::{Context, Result, bail}; +use anyhow::{bail, Context, Result}; use log::{error, info}; use url::Url; @@ -31,7 +31,7 @@ fn is_empty(project: &task::Project) -> Result { } #[allow(clippy::too_many_lines)] -pub fn handle(command: OpenCommand, state: &mut State) -> Result<()> { +pub async fn handle(command: OpenCommand, state: &mut State) -> Result<()> { match command { OpenCommand::Review { non_empty } => { for project in task::Project::all().context("Failed to get all project files")? { @@ -43,12 +43,14 @@ pub fn handle(command: OpenCommand, state: &mut State) -> Result<()> { project.to_project_display(), if is_empty { "is empty" } else { "is not empty" } ); - open_in_browser(project, state, None::>).with_context(|| { - format!( - "Failed to open project ('{}') in qutebrowser", - project.to_project_display() - ) - })?; + open_in_browser(project, state, None::>) + .await + .with_context(|| { + format!( + "Failed to open project ('{}') in qutebrowser", + project.to_project_display() + ) + })?; if project.is_touched() { project.untouch().with_context(|| { @@ -63,9 +65,11 @@ pub fn handle(command: OpenCommand, state: &mut State) -> Result<()> { } OpenCommand::Project { project, urls } => { project.touch().context("Failed to touch project")?; - open_in_browser(&project, state, urls).with_context(|| { - format!("Failed to open project: {}", project.to_project_display()) - })?; + open_in_browser(&project, state, urls) + .await + .with_context(|| { + format!("Failed to open project: {}", project.to_project_display()) + })?; } OpenCommand::Select { urls } => { let selected_project: task::Project = task::Project::from_project_string( @@ -85,7 +89,9 @@ pub fn handle(command: OpenCommand, state: &mut State) -> Result<()> { .touch() .context("Failed to touch project")?; - open_in_browser(&selected_project, state, urls).context("Failed to open project")?; + open_in_browser(&selected_project, state, urls) + .await + .context("Failed to open project")?; } OpenCommand::ListTabs { projects, mode } => { let projects = { @@ -152,7 +158,13 @@ pub fn handle(command: OpenCommand, state: &mut State) -> Result<()> { }; for (active, url) in tabs { - let is_selected = { if active { "🔻 " } else { " " } }; + let is_selected = { + if active { + "🔻 " + } else { + " " + } + }; println!("{is_selected}{url}"); } } -- cgit v1.3.1