fmt + import optimisation

i18n
michal 2 years ago
parent 52b893a063
commit 9e55999174

@ -45,7 +45,7 @@ path = "src/main.rs"
[profile.release] [profile.release]
incremental = true incremental = true
debug = true debug = false
lto = "fat" lto = "fat"
codegen-units = 1 codegen-units = 1

@ -11,7 +11,7 @@ pub fn add(pkg: Package, options: Options) {
"{}/.local/share/ame/db.sqlite", "{}/.local/share/ame/db.sqlite",
env::var("HOME").unwrap() env::var("HOME").unwrap()
))) )))
.expect("Couldn't connect to database"); .expect("Couldn't connect to database");
if options.verbosity >= 1 { if options.verbosity >= 1 {
log(format!("Adding package {} to database", pkg.name)); log(format!("Adding package {} to database", pkg.name));

@ -31,8 +31,8 @@ pub fn init(options: Options) {
)", )",
[], [],
) )
.unwrap_or_else(|e| { .unwrap_or_else(|e| {
crash(format!("Couldn't initialise database: {}", e), 3); crash(format!("Couldn't initialise database: {}", e), 3);
1 1
}); });
} }

@ -17,7 +17,7 @@ pub fn query(options: Options) -> Vec<Package> {
"{}/.local/share/ame/db.sqlite", "{}/.local/share/ame/db.sqlite",
env::var("HOME").unwrap() env::var("HOME").unwrap()
))) )))
.expect("Couldn't connect to database"); .expect("Couldn't connect to database");
if verbosity >= 1 { if verbosity >= 1 {
log("Querying database for input".to_string()); log("Querying database for input".to_string());

@ -10,7 +10,7 @@ pub fn remove(pkg: &str, options: Options) {
"{}/.local/share/ame/db.sqlite", "{}/.local/share/ame/db.sqlite",
env::var("HOME").unwrap() env::var("HOME").unwrap()
))) )))
.expect("Couldn't connect to database"); .expect("Couldn't connect to database");
let verbosity = options.verbosity; let verbosity = options.verbosity;
@ -26,5 +26,5 @@ pub fn remove(pkg: &str, options: Options) {
WHERE name = ?);", WHERE name = ?);",
[pkg], [pkg],
) )
.expect("Couldn't delete package from database"); .expect("Couldn't delete package from database");
} }

@ -50,4 +50,4 @@ macro_rules! uwu {
uwu uwu
}}; }};
} }

@ -23,7 +23,7 @@ pub fn crash(a: String, b: i32) {
a a
}; };
println!("\x1b[2;22;31m❌\x1b[0m \x1b[1;91m{}\x1b[0m", a); println!("\x1b[2;22;31m❌:\x1b[0m \x1b[1;91m{}\x1b[0m", a);
exit(b); exit(b);
} }

@ -199,9 +199,9 @@ fn main() {
.unwrap() .unwrap()
.is_present("repo") .is_present("repo")
&& !matches && !matches
.subcommand_matches("search") .subcommand_matches("search")
.unwrap() .unwrap()
.is_present("aur") .is_present("aur")
{ {
info(format!("Searching AUR and repos for {}", &packages[0])); info(format!("Searching AUR and repos for {}", &packages[0]));
operations::search(&packages[0], options); operations::search(&packages[0], options);

@ -39,7 +39,7 @@ pub fn uninstall(mut a: Vec<String>, options: Options) {
env::var("HOME").unwrap(), env::var("HOME").unwrap(),
b b
))) )))
.unwrap(); .unwrap();
} }
} }
} }

Loading…
Cancel
Save