Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 44 additions & 33 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gpgme = "0.11"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
git2 = "0.20"
rand = "0.9"
whoami = "1"
whoami = "2"
toml = "0.9"
reqwest = { version = "0.13", features = ["blocking"] }
hex = "0.4"
Expand All @@ -36,6 +36,9 @@ flate2 = "1"
tar = "0.4"
criterion = "0.8"

[lints.clippy]
pedantic = "warn"

[workspace]

members = [
Expand Down
12 changes: 6 additions & 6 deletions benches/library_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ fn cleanup(mut base_path: PathBuf, path_name: &str) -> Result<(), std::io::Error
fn pop_list(password_dir: PathBuf) -> pass::Result<()> {
let store = pass::PasswordStore::new(
"",
&Some(password_dir),
&None,
&None,
&None,
&CryptoImpl::GpgMe,
&None,
Some(&password_dir),
None,
None,
None,
CryptoImpl::GpgMe,
None,
)?;
let results = store.all_passwords().unwrap();

Expand Down
6 changes: 4 additions & 2 deletions cursive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ ripasso = { path = "../", version = "0.8.0" }
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"] }
Expand All @@ -28,9 +27,12 @@ default-features = false
features = ["toml"]

[dev-dependencies]
tempfile = "3.10.1"
tempfile = "3"
chrono = { version = "0.4", default-features = false, features = ["clock"] }

[build-dependencies]
glob = "0.3"
man = "0.3"

[lints.clippy]
pedantic = "warn"
12 changes: 6 additions & 6 deletions cursive/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ fn generate_man_page_file() {
dest_path.pop();
dest_path.pop();
dest_path.push("man-page");
print!("creating directory: {:?} ", &dest_path);
print!("creating directory: {} ", dest_path.display());
let res = std::fs::create_dir(&dest_path);
if res.is_ok() {
println!("success");
} else {
println!("error: {:?}", res.err().unwrap());
}
dest_path.push("cursive");
print!("creating directory: {:?} ", &dest_path);
print!("creating directory: {} ", dest_path.display());
let res = std::fs::create_dir(&dest_path);
if res.is_ok() {
println!("success");
Expand All @@ -94,15 +94,15 @@ fn generate_translation_files() {
dest_path.pop();
dest_path.pop();
dest_path.push("translations");
print!("creating directory: {:?} ", &dest_path);
print!("creating directory: {} ", dest_path.display());
let res = std::fs::create_dir(&dest_path);
if res.is_ok() {
println!("success");
} else {
println!("error: {:?}", res.err().unwrap());
}
dest_path.push("cursive");
print!("creating directory: {:?} ", &dest_path);
print!("creating directory: {} ", dest_path.display());
let res = std::fs::create_dir(&dest_path);
if res.is_ok() {
println!("success");
Expand All @@ -128,8 +128,8 @@ fn generate_translation_files() {
filename.replace_range(3..4, "m");

print!(
"generating .mo file for {:?} to {}/{} ",
&file,
"generating .mo file for {} to {}/{} ",
file.display(),
dest_path.display(),
&filename
);
Expand Down
10 changes: 4 additions & 6 deletions cursive/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

use std::sync::{Arc, Mutex};
use std::sync::{Arc, LazyLock, Mutex};

use arboard::Clipboard;
use cursive::{
Cursive,
event::Key,
views::{Checkbox, Dialog, EditView, OnEventView, RadioButton, TextView},
};
use lazy_static::lazy_static;
use pass::Result;
use ripasso::{crypto::CryptoImpl, pass, pass::Recipient};

lazy_static! {
static ref CLIPBOARD: Arc<Mutex<Clipboard>> = Arc::new(Mutex::new(Clipboard::new().unwrap()));
}
static CLIPBOARD: LazyLock<Arc<Mutex<Clipboard>>> =
LazyLock::new(|| Arc::new(Mutex::new(Clipboard::new().unwrap())));

/// Displays an error in a cursive dialog
pub fn errorbox(ui: &mut Cursive, err: &pass::Error) {
Expand All @@ -52,7 +50,7 @@ pub fn errorbox(ui: &mut Cursive, err: &pass::Error) {
}

/// Copies content to the clipboard.
pub fn set_clipboard(content: &String) -> Result<()> {
pub fn set_clipboard(content: &str) -> Result<()> {
Ok(CLIPBOARD.lock().unwrap().set_text(content)?)
}

Expand Down
Loading
Loading