From f045f86f3e945ae9f6c5f0aa779b754a4135e34c Mon Sep 17 00:00:00 2001 From: michal Date: Tue, 18 Jan 2022 19:25:29 +0000 Subject: [PATCH] string consistency --- src/database/add.rs | 2 +- src/database/query.rs | 4 ++-- src/database/remove.rs | 4 ++-- src/internal/sort.rs | 8 ++++---- src/main.rs | 6 +++--- src/operations/aur_install.rs | 6 +++--- src/operations/install.rs | 2 +- src/operations/search.rs | 8 ++++---- src/operations/uninstall.rs | 4 ++-- src/operations/upgrade.rs | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/database/add.rs b/src/database/add.rs index 00920db..cfbcecd 100644 --- a/src/database/add.rs +++ b/src/database/add.rs @@ -9,7 +9,7 @@ pub fn add(pkg: Package, options: Options) { "{}/.local/share/ame/db.sqlite", env::var("HOME").unwrap() ))) - .expect("Couldn't connect to database."); + .expect("Couldn't connect to database"); if options.verbosity >= 1 { eprintln!("Adding package {} to database", pkg.name); diff --git a/src/database/query.rs b/src/database/query.rs index b27416a..b84ee6a 100644 --- a/src/database/query.rs +++ b/src/database/query.rs @@ -15,7 +15,7 @@ pub fn query(a: &str, options: Options) -> Vec { "{}/.local/share/ame/db.sqlite", env::var("HOME").unwrap() ))) - .expect("Couldn't connect to database."); + .expect("Couldn't connect to database"); if verbosity >= 1 { eprintln!("Querying database for input") @@ -44,7 +44,7 @@ pub fn query(a: &str, options: Options) -> Vec { .collect::>(), }) }) - .expect("Couldn't query database for packages."); + .expect("Couldn't query database for packages"); if verbosity >= 1 { eprintln!("Retrieved results"); diff --git a/src/database/remove.rs b/src/database/remove.rs index 44c8a00..a189e40 100644 --- a/src/database/remove.rs +++ b/src/database/remove.rs @@ -8,7 +8,7 @@ pub fn remove(pkg: &str, options: Options) { "{}/.local/share/ame/db.sqlite", env::var("HOME").unwrap() ))) - .expect("Couldn't connect to database."); + .expect("Couldn't connect to database"); let verbosity = options.verbosity; @@ -24,5 +24,5 @@ pub fn remove(pkg: &str, options: Options) { WHERE name = ?);", [pkg], ) - .expect("Couldn't delete package from database."); + .expect("Couldn't delete package from database"); } diff --git a/src/internal/sort.rs b/src/internal/sort.rs index a1fb26d..71a9966 100644 --- a/src/internal/sort.rs +++ b/src/internal/sort.rs @@ -30,21 +30,21 @@ pub fn sort(input: &[String], options: Options) -> structs::Sorted { .arg(format!("^{}$", &b)) .stdout(Stdio::null()) .status() - .expect("Something has gone wrong."); + .expect("Something has gone wrong"); if rpc::rpcinfo(b.to_string()).found { if verbosity >= 1 { - eprintln!("{} found in AUR.", b); + eprintln!("{} found in AUR", b); } aur.push(b.to_string()); } else if let Some(0) = rs.code() { if verbosity >= 1 { - eprintln!("{} found in repos.", b) + eprintln!("{} found in repos", b) } repo.push(b.to_string()); } else { if verbosity >= 1 { - eprintln!("{} not found.", b); + eprintln!("{} not found", b); } nf.push(b.to_string()); } diff --git a/src/main.rs b/src/main.rs index 56daa13..4126aa4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ fn main() { } if unsafe { geteuid() } == 0 { - panic!("Running amethyst as root is disallowed as it can lead to system breakage. Instead, amethyst will prompt you when it needs superuser permissions.") + panic!("Running amethyst as root is disallowed as it can lead to system breakage. Instead, amethyst will prompt you when it needs superuser permissions") } let matches = App::new("Amethyst") @@ -58,7 +58,7 @@ fn main() { ) .subcommand( SubCommand::with_name("search") - .about("Searches for the relevant packages in both the AUR and repos.") + .about("Searches for the relevant packages in both the AUR and repos") .aliases(&["-Ss", "sea"]) .arg( Arg::with_name("aur") @@ -125,7 +125,7 @@ fn main() { } if !sorted.nf.is_empty() { eprintln!( - "Couldn't find packages: {} in repos or the AUR.", + "Couldn't find packages: {} in repos or the AUR", sorted.nf.join(", ") ); } diff --git a/src/operations/aur_install.rs b/src/operations/aur_install.rs index 5ede818..4e7ad5c 100644 --- a/src/operations/aur_install.rs +++ b/src/operations/aur_install.rs @@ -44,7 +44,7 @@ pub fn aur_install(a: Vec, options: Options) { .arg("clone") .arg(format!("{}/{}", url, pkg)) .status() - .expect("Something has gone wrong."); + .expect("Something has gone wrong"); if verbosity >= 1 { eprintln!( @@ -73,7 +73,7 @@ pub fn aur_install(a: Vec, options: Options) { if !sorted.nf.is_empty() { panic!( - "Could not find dependencies {} for package {}. Aborting", + "Could not find dependencies {} for package {}, aborting", sorted.nf.join(", "), pkg ); @@ -107,7 +107,7 @@ pub fn aur_install(a: Vec, options: Options) { Command::new("makepkg") .args(&makepkg_args) .status() - .expect("Something has gone wrong."); + .expect("Something has gone wrong"); if makepkg_args.contains(&"--asdeps") { set_current_dir(&cachedir).unwrap(); diff --git a/src/operations/install.rs b/src/operations/install.rs index 45796d7..44bff47 100644 --- a/src/operations/install.rs +++ b/src/operations/install.rs @@ -32,7 +32,7 @@ pub fn install(mut a: Vec, options: Options) { if let Some(x) = r.code() { if verbosity >= 1 { - eprintln!("Installing packages: {:?} exited with code {}.", &b, x) + eprintln!("Installing packages: {:?} exited with code {}", &b, x) } } } diff --git a/src/operations/search.rs b/src/operations/search.rs index 28d7a55..8ad115b 100644 --- a/src/operations/search.rs +++ b/src/operations/search.rs @@ -7,7 +7,7 @@ pub fn aur_search(a: &str, options: Options) { let res = rpcsearch(a.to_string()); if verbosity >= 1 { - eprintln!("Found {} results for \"{}\" in AUR.", res.resultcount, a); + eprintln!("Found {} results for \"{}\" in AUR", res.resultcount, a); } for r in &res.results { @@ -17,7 +17,7 @@ pub fn aur_search(a: &str, options: Options) { r.version, r.description .as_ref() - .unwrap_or(&"No description.".to_string()) + .unwrap_or(&"No description".to_string()) ) } } @@ -28,13 +28,13 @@ pub fn repo_search(a: &str, options: Options) { .arg("-Ss") .arg(format!("^{}$", &a)) .output() - .expect("Something has gone wrong."); + .expect("Something has gone wrong"); let str = String::from_utf8(rs.stdout).unwrap(); if verbosity >= 1 { eprintln!( - "Found {} results for \"{}\" in repos.", + "Found {} results for \"{}\" in repos", &str.split('\n').count() / 2, &a ); diff --git a/src/operations/uninstall.rs b/src/operations/uninstall.rs index f95a49e..6d6b79a 100644 --- a/src/operations/uninstall.rs +++ b/src/operations/uninstall.rs @@ -26,11 +26,11 @@ pub fn uninstall(mut a: Vec, options: Options) { .arg("-Rs") .args(&a) .status() - .expect("Something has gone wrong."); + .expect("Something has gone wrong"); if let Some(x) = r.code() { if verbosity >= 1 { - eprintln!("Uninstalling packages: {:?} exited with code {}.", &b, x) + eprintln!("Uninstalling packages: {:?} exited with code {}", &b, x) } } diff --git a/src/operations/upgrade.rs b/src/operations/upgrade.rs index c287157..f98b242 100644 --- a/src/operations/upgrade.rs +++ b/src/operations/upgrade.rs @@ -19,7 +19,7 @@ pub fn upgrade(options: Options) { Command::new("pacman") .args(&pacman_args) .status() - .expect("Something has gone wrong."); + .expect("Something has gone wrong"); if verbosity >= 1 { eprintln!("Upgrading AUR packages")