Skip to content

Commit b5873db

Browse files
Merge pull request #370 from cortex/more-cleanup
more minor cleanup
2 parents f66b5c4 + 363edc3 commit b5873db

File tree

14 files changed

+368
-256
lines changed

14 files changed

+368
-256
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ license = "GPL-3.0-only"
99
edition = '2021'
1010

1111
[dependencies]
12-
arboard = "3.4.0"
13-
glob = "0.3.1"
14-
gpgme = "0.11.0"
12+
arboard = "3"
13+
glob = "0.3"
14+
gpgme = "0.11"
1515
chrono = { version = "0.4", default-features = false, features = ["clock"] }
16-
git2 = "0.20.0"
17-
rand = "0.8.5"
18-
whoami = "1.4.1"
19-
toml = "0.8.10"
16+
git2 = "0.20"
17+
rand = "0.8"
18+
whoami = "1"
19+
toml = "0.8"
2020
reqwest = { version = "0.12", features = ["blocking"] }
21-
hex = "0.4.3"
22-
totp-rs = { version = "5.5.1", features = ["otpauth"] }
23-
sequoia-openpgp = "1.21.0"
24-
anyhow = "1.0.80"
25-
sequoia-gpg-agent = "0.4.0"
26-
zeroize = { version = "1.8.0", features = ["zeroize_derive", "alloc"] }
21+
hex = "0.4"
22+
totp-rs = { version = "5", features = ["otpauth"] }
23+
sequoia-openpgp = "1"
24+
anyhow = "1"
25+
sequoia-gpg-agent = "0.5"
26+
zeroize = { version = "1", features = ["zeroize_derive", "alloc"] }
2727

2828
[dependencies.config]
29-
version = "0.15.4"
29+
version = "0.15"
3030
default-features = false
3131
features = ["toml"]
3232

3333
[dev-dependencies]
34-
tempfile = "3.12.0"
35-
flate2 = "1.0.28"
36-
tar = "0.4.40"
37-
criterion = "0.5.1"
34+
tempfile = "3"
35+
flate2 = "1"
36+
tar = "0.4"
37+
criterion = "0.5"
3838

3939
[workspace]
4040

cursive/Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ edition = '2021'
1111
build = "build.rs"
1212

1313
[dependencies]
14-
cursive = { version = "0.21.0", default-features = false, features = ["toml", "crossterm-backend"]}
15-
arboard = { version = "3.3.0", features = ["wayland-data-control"]}
14+
cursive = { version = "0.21", default-features = false, features = ["toml", "crossterm-backend"]}
15+
arboard = { version = "3", features = ["wayland-data-control"]}
1616
ripasso = { path = "../", version = "0.7.0-alpha" }
17-
locale_config = "0.3.0"
18-
unic-langid = "0.9.4"
19-
gettext = "0.4.0"
20-
lazy_static = "1.4.0"
21-
terminal_size = "0.3.0"
22-
hex = "0.4.3"
23-
zeroize = { version = "1.7.0", features = ["zeroize_derive", "alloc"] }
17+
locale_config = "0.3"
18+
unic-langid = "0.9"
19+
gettext = "0.4"
20+
lazy_static = "1"
21+
terminal_size = "0.4"
22+
hex = "0.4"
23+
zeroize = { version = "1", features = ["zeroize_derive", "alloc"] }
2424

2525
[dependencies.config]
26-
version = "0.15.5"
26+
version = "0.15"
2727
default-features = false
2828
features = ["toml"]
2929

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

3434
[build-dependencies]
35-
glob = "0.3.1"
36-
man = "0.3.0"
35+
glob = "0.3"
36+
man = "0.3"

cursive/src/helpers.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use cursive::{
2424
};
2525
use lazy_static::lazy_static;
2626
use pass::Result;
27+
use ripasso::pass::Recipient;
2728
use ripasso::{crypto::CryptoImpl, pass};
2829

2930
lazy_static! {
@@ -81,6 +82,20 @@ pub fn is_radio_button_selected(s: &mut Cursive, button_name: &str) -> bool {
8182
selected
8283
}
8384

85+
pub fn recipients_widths(recipients: &[Recipient]) -> (usize, usize) {
86+
let mut max_width_key = 0;
87+
let mut max_width_name = 0;
88+
for recipient in recipients {
89+
if recipient.key_id.len() > max_width_key {
90+
max_width_key = recipient.key_id.len();
91+
}
92+
if recipient.name.len() > max_width_name {
93+
max_width_name = recipient.name.len();
94+
}
95+
}
96+
(max_width_key, max_width_name)
97+
}
98+
8499
#[cfg(test)]
85100
#[path = "tests/helpers.rs"]
86101
mod helpers_tests;

0 commit comments

Comments
 (0)