Skip to content

Commit e4452ad

Browse files
sync from internal repository
1 parent b4ce729 commit e4452ad

File tree

9 files changed

+55
-52
lines changed

9 files changed

+55
-52
lines changed

dkdc-links-py/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dkdc-links-py/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[package]
44
name = "dkdc-links-py"
5-
version = "4.1.0"
6-
edition = "2024"
5+
version = "4.1.1"
6+
edition = "2021"
77
authors = ["Cody <cody@dkdc.dev>"]
88
license = "MIT"
99

dkdc-links/Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dkdc-links/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
[workspace]
22

33
[profile.release]
4-
# fat LTO (lto = true) causes SIGSEGV in nightly rustc with iced's dependency tree.
5-
# thin LTO gives ~95% of the size/perf benefit without the compiler crash.
6-
lto = "thin"
4+
lto = true
75
strip = true
86
codegen-units = 1
97

108
[package]
119
name = "dkdc-links"
12-
version = "4.1.0"
13-
edition = "2024"
10+
version = "4.1.1"
11+
edition = "2021"
1412
authors = ["Cody <cody@dkdc.dev>"]
1513
description = "Bookmarks in your terminal"
1614
repository = "https://github.com/lostmygithubaccount/dkdc-links"

dkdc-links/src/app.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Desktop app for dkdc-links
22
33
use iced::widget::{
4-
Column, button, center, checkbox, column, container, mouse_area, row, scrollable, text,
5-
text_input,
4+
button, center, checkbox, column, container, mouse_area, row, scrollable, text, text_input,
5+
Column,
66
};
77
use iced::{Element, Length, Size, Theme};
88
use std::collections::HashSet;
@@ -455,11 +455,11 @@ impl Links {
455455
fn apply_edit(&mut self, kind: ItemKind, name: &str, field: &str, value: &str) {
456456
match (kind, field) {
457457
(ItemKind::Link, "name") => {
458-
if value != name
459-
&& let Err(e) = self.config.rename_link(name, value)
460-
{
461-
self.error = Some(e.to_string());
462-
return;
458+
if value != name {
459+
if let Err(e) = self.config.rename_link(name, value) {
460+
self.error = Some(e.to_string());
461+
return;
462+
}
463463
}
464464
}
465465
(ItemKind::Link, "value") => {
@@ -468,11 +468,11 @@ impl Links {
468468
}
469469
}
470470
(ItemKind::Alias, "name") => {
471-
if value != name
472-
&& let Err(e) = self.config.rename_alias(name, value)
473-
{
474-
self.error = Some(e.to_string());
475-
return;
471+
if value != name {
472+
if let Err(e) = self.config.rename_alias(name, value) {
473+
self.error = Some(e.to_string());
474+
return;
475+
}
476476
}
477477
}
478478
(ItemKind::Alias, "value") => {
@@ -485,10 +485,10 @@ impl Links {
485485
}
486486
}
487487
(ItemKind::Group, "name") => {
488-
if value != name
489-
&& let Some(entries) = self.config.groups.remove(name)
490-
{
491-
self.config.groups.insert(value.to_string(), entries);
488+
if value != name {
489+
if let Some(entries) = self.config.groups.remove(name) {
490+
self.config.groups.insert(value.to_string(), entries);
491+
}
492492
}
493493
}
494494
(ItemKind::Group, "value") => {

dkdc-links/src/webapp.rs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Embedded HTMX webapp for dkdc-links
22
3-
use axum::Router;
43
use axum::extract::{Path, Query, State};
54
use axum::response::Html;
65
use axum::routing::{get, post};
6+
use axum::Router;
77
use std::net::SocketAddr;
88
use std::sync::{Arc, Mutex};
99

@@ -718,17 +718,18 @@ async fn edit_link(
718718
let new_name = form.get("new_name").filter(|s| !s.is_empty());
719719
let new_url = form.get("new_url").filter(|s| !s.is_empty());
720720

721-
if let Some(new_url) = new_url
722-
&& let Some(url) = config.links.get_mut(&name)
723-
{
724-
*url = new_url.clone();
721+
if let Some(new_url) = new_url {
722+
if let Some(url) = config.links.get_mut(&name) {
723+
*url = new_url.clone();
724+
}
725725
}
726726

727-
if let Some(new_name) = new_name
728-
&& new_name != &name
729-
&& let Err(e) = config.rename_link(&name, new_name)
730-
{
731-
return content_err(&state, &e.to_string());
727+
if let Some(new_name) = new_name {
728+
if new_name != &name {
729+
if let Err(e) = config.rename_link(&name, new_name) {
730+
return content_err(&state, &e.to_string());
731+
}
732+
}
732733
}
733734

734735
state.save_config(&config);
@@ -756,11 +757,12 @@ async fn edit_alias(
756757
}
757758
}
758759

759-
if let Some(new_name) = new_name
760-
&& new_name != &name
761-
&& let Err(e) = config.rename_alias(&name, new_name)
762-
{
763-
return content_err(&state, &e.to_string());
760+
if let Some(new_name) = new_name {
761+
if new_name != &name {
762+
if let Err(e) = config.rename_alias(&name, new_name) {
763+
return content_err(&state, &e.to_string());
764+
}
765+
}
764766
}
765767

766768
state.save_config(&config);
@@ -800,11 +802,12 @@ async fn edit_group(
800802
}
801803
}
802804

803-
if let Some(new_name) = new_name
804-
&& new_name != &name
805-
&& let Some(entries) = config.groups.remove(&name)
806-
{
807-
config.groups.insert(new_name.clone(), entries);
805+
if let Some(new_name) = new_name {
806+
if new_name != &name {
807+
if let Some(entries) = config.groups.remove(&name) {
808+
config.groups.insert(new_name.clone(), entries);
809+
}
810+
}
808811
}
809812

810813
state.save_config(&config);

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "dkdc-links"
3-
version = "4.1.0"
3+
version = "4.1.1"
44
description = "Bookmarks in your terminal"
55
authors = [{ name = "Cody", email = "cody@dkdc.dev" }]
66
requires-python = ">=3.11"

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "stable"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)