aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ts/tskm/src/interface/open/handle.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-03 18:26:23 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-03 18:26:23 +0200
commit821ada0b8c3ffef3d4286f3c4fc15871ff9b5f65 (patch)
treeccda5ab8d3cc298c85422cf83c3d95274de77747 /pkgs/by-name/ts/tskm/src/interface/open/handle.rs
parentpkgs/*/update.sh: Perform more through cargo updates (diff)
downloadnixos-config-821ada0b8c3ffef3d4286f3c4fc15871ff9b5f65.zip
pkgs/tskm: Update `taskchampion` to 3.x
Diffstat (limited to 'pkgs/by-name/ts/tskm/src/interface/open/handle.rs')
-rw-r--r--pkgs/by-name/ts/tskm/src/interface/open/handle.rs38
1 files changed, 25 insertions, 13 deletions
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<bool> {
}
#[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::<Vec<Url>>).with_context(|| {
- format!(
- "Failed to open project ('{}') in qutebrowser",
- project.to_project_display()
- )
- })?;
+ open_in_browser(project, state, None::<Vec<Url>>)
+ .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}");
}
}