From ff13da9a85b111a803a5cb057ca64e905867bf47 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Tue, 22 Sep 2020 21:46:39 +0200 Subject: [PATCH] Fix formatting --- src/keyboard/windows.rs | 2 +- src/main.rs | 11 ++++++++--- src/package/mod.rs | 6 +++++- src/package/zip.rs | 6 +++++- src/ui/modulo/mac.rs | 13 ++++++++----- src/ui/modulo/mod.rs | 8 ++++++-- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/keyboard/windows.rs b/src/keyboard/windows.rs index 55b1b1d..507d4dd 100644 --- a/src/keyboard/windows.rs +++ b/src/keyboard/windows.rs @@ -89,4 +89,4 @@ pub fn wait_for_modifiers_release() -> bool { std::thread::sleep(std::time::Duration::from_millis(100)); } false -} \ No newline at end of file +} diff --git a/src/main.rs b/src/main.rs index f35abe6..294ad3c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,8 +98,13 @@ fn main() { .required(false) .default_value("hub"), ) - .arg(Arg::with_name("proxy").help("Use a proxy, should be used as --proxy=https://proxy:1234") - .required(false).long("proxy").takes_value(true)); + .arg( + Arg::with_name("proxy") + .help("Use a proxy, should be used as --proxy=https://proxy:1234") + .required(false) + .long("proxy") + .takes_value(true), + ); let uninstall_subcommand = SubCommand::with_name("uninstall") .about("Remove an installed package. Equivalent to 'espanso package uninstall'") @@ -1103,7 +1108,7 @@ fn install_main(_config_set: ConfigSet, matches: &ArgMatches) { println!("Using proxy: {}", proxy); Some(proxy.to_string()) } - None => {None} + None => None, }; let package_resolver = Box::new(ZipPackageResolver::new()); diff --git a/src/package/mod.rs b/src/package/mod.rs index 8906c8c..ea6d23d 100644 --- a/src/package/mod.rs +++ b/src/package/mod.rs @@ -49,7 +49,11 @@ pub trait PackageManager { } pub trait PackageResolver { - fn clone_repo_to_temp(&self, repo_url: &str, proxy: Option) -> Result>; + fn clone_repo_to_temp( + &self, + repo_url: &str, + proxy: Option, + ) -> Result>; } #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] diff --git a/src/package/zip.rs b/src/package/zip.rs index 8b90ab4..4912e5f 100644 --- a/src/package/zip.rs +++ b/src/package/zip.rs @@ -13,7 +13,11 @@ impl ZipPackageResolver { } impl super::PackageResolver for ZipPackageResolver { - fn clone_repo_to_temp(&self, repo_url: &str, proxy: Option) -> Result> { + fn clone_repo_to_temp( + &self, + repo_url: &str, + proxy: Option, + ) -> Result> { let temp_dir = TempDir::new()?; let zip_url = repo_url.to_owned() + "/archive/master.zip"; diff --git a/src/ui/modulo/mac.rs b/src/ui/modulo/mac.rs index 4919ca4..1b55b2e 100644 --- a/src/ui/modulo/mac.rs +++ b/src/ui/modulo/mac.rs @@ -1,6 +1,6 @@ use log::info; -use std::path::PathBuf; use std::os::unix::fs::symlink; +use std::path::PathBuf; const MODULO_APP_BUNDLE_NAME: &str = "Modulo.app"; const MODULO_APP_BUNDLE_PLIST_CONTENT: &'static str = include_str!("../../res/mac/modulo.plist"); @@ -11,13 +11,16 @@ pub fn generate_modulo_app_bundle(modulo_path: &str) -> Result Result Result