honestly not sure what i've done to anger the vcs gods today

i18n
michal 3 years ago
parent 16cbf09d89
commit 52b893a063

@ -16,9 +16,12 @@
### Good Practices ### Good Practices
- Try to use .unwrap() as little as possible - Try to use .unwrap() as little as possible
- Try to never use panic!() in production code, always try to have a possible way to resolve errors, even if it's just unwrap_or/_else() - Try to never use panic!() in production code, always try to have a possible way to resolve errors, even if it's just
- Never use println!() or eprintln!() in finalised code. Using string functions (e.g. info() in Amethyst v3.0.0) is preferred unwrap_or/_else()
- Compartmentalise as much as you can, avoid writing the exact same line of code 50 times if you can turn it into a function - Never use println!() or eprintln!() in finalised code. Using string functions (e.g. info() in Amethyst v3.0.0) is
preferred
- Compartmentalise as much as you can, avoid writing the exact same line of code 50 times if you can turn it into a
function
### Examples of these guidelines in practice ### Examples of these guidelines in practice

@ -32,7 +32,6 @@ Made for Crystal, compatible with any Arch-based Linux distribution.</p>
| 6 | User cancelled package installation | | 6 | User cancelled package installation |
| 7 | Pacman error when installing package | | 7 | Pacman error when installing package |
## How to build: ## How to build:
Tested on latest Cargo (1.60.0-nightly) Tested on latest Cargo (1.60.0-nightly)

@ -3,8 +3,8 @@ use std::path::Path;
use rusqlite::Connection; use rusqlite::Connection;
use crate::internal::rpc::Package;
use crate::{crash, log, Options}; use crate::{crash, log, Options};
use crate::internal::rpc::Package;
pub fn add(pkg: Package, options: Options) { pub fn add(pkg: Package, options: Options) {
let conn = Connection::open(Path::new(&format!( let conn = Connection::open(Path::new(&format!(

@ -3,8 +3,8 @@ use std::path::Path;
use rusqlite::Connection; use rusqlite::Connection;
use crate::internal::rpc::Package;
use crate::{log, Options}; use crate::{log, Options};
use crate::internal::rpc::Package;
pub fn query(options: Options) -> Vec<Package> { pub fn query(options: Options) -> Vec<Package> {
let verbosity = options.verbosity; let verbosity = options.verbosity;

@ -1,7 +1,7 @@
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use crate::internal::strings::log;
use crate::internal::{clean, rpc, structs}; use crate::internal::{clean, rpc, structs};
use crate::internal::strings::log;
use crate::Options; use crate::Options;
pub fn sort(input: &[String], options: Options) -> structs::Sorted { pub fn sort(input: &[String], options: Options) -> structs::Sorted {

@ -1,8 +1,8 @@
use std::{env, io};
use std::io::Write; use std::io::Write;
use std::process::exit; use std::process::exit;
use std::str::FromStr; use std::str::FromStr;
use std::time::UNIX_EPOCH; use std::time::UNIX_EPOCH;
use std::{env, io};
use crate::uwu; use crate::uwu;

@ -4,9 +4,9 @@ use std::fs::remove_dir_all;
use std::path::Path; use std::path::Path;
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use crate::internal::rpc::rpcinfo;
use crate::internal::{crash, prompt};
use crate::{info, log, Options}; use crate::{info, log, Options};
use crate::internal::{crash, prompt};
use crate::internal::rpc::rpcinfo;
pub fn aur_install(a: Vec<String>, options: Options) { pub fn aur_install(a: Vec<String>, options: Options) {
let url = crate::internal::rpc::URL; let url = crate::internal::rpc::URL;

@ -1,7 +1,7 @@
use std::process::Command; use std::process::Command;
use crate::internal::rpc::rpcsearch;
use crate::{log, Options}; use crate::{log, Options};
use crate::internal::rpc::rpcsearch;
pub fn aur_search(a: &str, options: Options) { pub fn aur_search(a: &str, options: Options) {
let verbosity = options.verbosity; let verbosity = options.verbosity;

@ -1,5 +1,5 @@
use std::path::Path;
use std::{env, fs}; use std::{env, fs};
use std::path::Path;
use crate::{log, Options}; use crate::{log, Options};

@ -1,8 +1,8 @@
use runas::Command; use runas::Command;
use crate::{info, log, Options};
use crate::internal::rpc::rpcinfo; use crate::internal::rpc::rpcinfo;
use crate::operations::aur_install::aur_install; use crate::operations::aur_install::aur_install;
use crate::{info, log, Options};
pub fn upgrade(options: Options) { pub fn upgrade(options: Options) {
let verbosity = options.verbosity; let verbosity = options.verbosity;

Loading…
Cancel
Save