Skip to content

Commit

Permalink
more minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkjall committed Jan 12, 2025
1 parent f66b5c4 commit 363edc3
Show file tree
Hide file tree
Showing 14 changed files with 368 additions and 256 deletions.
144 changes: 123 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ license = "GPL-3.0-only"
edition = '2021'

[dependencies]
arboard = "3.4.0"
glob = "0.3.1"
gpgme = "0.11.0"
arboard = "3"
glob = "0.3"
gpgme = "0.11"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
git2 = "0.20.0"
rand = "0.8.5"
whoami = "1.4.1"
toml = "0.8.10"
git2 = "0.20"
rand = "0.8"
whoami = "1"
toml = "0.8"
reqwest = { version = "0.12", features = ["blocking"] }
hex = "0.4.3"
totp-rs = { version = "5.5.1", features = ["otpauth"] }
sequoia-openpgp = "1.21.0"
anyhow = "1.0.80"
sequoia-gpg-agent = "0.4.0"
zeroize = { version = "1.8.0", features = ["zeroize_derive", "alloc"] }
hex = "0.4"
totp-rs = { version = "5", features = ["otpauth"] }
sequoia-openpgp = "1"
anyhow = "1"
sequoia-gpg-agent = "0.5"
zeroize = { version = "1", features = ["zeroize_derive", "alloc"] }

[dependencies.config]
version = "0.15.4"
version = "0.15"
default-features = false
features = ["toml"]

[dev-dependencies]
tempfile = "3.12.0"
flate2 = "1.0.28"
tar = "0.4.40"
criterion = "0.5.1"
tempfile = "3"
flate2 = "1"
tar = "0.4"
criterion = "0.5"

[workspace]

Expand Down
24 changes: 12 additions & 12 deletions cursive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ edition = '2021'
build = "build.rs"

[dependencies]
cursive = { version = "0.21.0", default-features = false, features = ["toml", "crossterm-backend"]}
arboard = { version = "3.3.0", features = ["wayland-data-control"]}
cursive = { version = "0.21", default-features = false, features = ["toml", "crossterm-backend"]}
arboard = { version = "3", features = ["wayland-data-control"]}
ripasso = { path = "../", version = "0.7.0-alpha" }
locale_config = "0.3.0"
unic-langid = "0.9.4"
gettext = "0.4.0"
lazy_static = "1.4.0"
terminal_size = "0.3.0"
hex = "0.4.3"
zeroize = { version = "1.7.0", features = ["zeroize_derive", "alloc"] }
locale_config = "0.3"
unic-langid = "0.9"
gettext = "0.4"
lazy_static = "1"
terminal_size = "0.4"
hex = "0.4"
zeroize = { version = "1", features = ["zeroize_derive", "alloc"] }

[dependencies.config]
version = "0.15.5"
version = "0.15"
default-features = false
features = ["toml"]

Expand All @@ -32,5 +32,5 @@ tempfile = "3.10.1"
chrono = { version = "0.4", default-features = false, features = ["clock"] }

[build-dependencies]
glob = "0.3.1"
man = "0.3.0"
glob = "0.3"
man = "0.3"
15 changes: 15 additions & 0 deletions cursive/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use cursive::{
};
use lazy_static::lazy_static;
use pass::Result;
use ripasso::pass::Recipient;
use ripasso::{crypto::CryptoImpl, pass};

lazy_static! {
Expand Down Expand Up @@ -81,6 +82,20 @@ pub fn is_radio_button_selected(s: &mut Cursive, button_name: &str) -> bool {
selected
}

pub fn recipients_widths(recipients: &[Recipient]) -> (usize, usize) {
let mut max_width_key = 0;
let mut max_width_name = 0;
for recipient in recipients {
if recipient.key_id.len() > max_width_key {
max_width_key = recipient.key_id.len();
}
if recipient.name.len() > max_width_name {
max_width_name = recipient.name.len();
}
}
(max_width_key, max_width_name)
}

#[cfg(test)]
#[path = "tests/helpers.rs"]
mod helpers_tests;
Loading

0 comments on commit 363edc3

Please sign in to comment.