From 082fe6f1e3d0d761b7738cc18914809316e7a2cc Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 13 Sep 2019 15:21:05 +0200 Subject: [PATCH] auto formatted code with rustfmt --- src/app.rs | 57 ++-- src/error.rs | 26 +- src/file_assoc.rs | 60 +++-- src/main.rs | 326 ++++++++++++++--------- src/manifest.rs | 577 +++++++++++++++++++++++------------------ src/platform.rs | 33 ++- src/templates.rs | 72 ++--- src/util.rs | 23 +- tests/integration.rs | 9 +- tests/tests/expr.rs | 54 ++-- tests/tests/script.rs | 37 ++- tests/tests/version.rs | 3 +- tests/util/mod.rs | 19 +- 13 files changed, 766 insertions(+), 530 deletions(-) diff --git a/src/app.rs b/src/app.rs index 50cc7aca..590f229c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,7 +1,7 @@ use std::env; use std::path::PathBuf; -use clap::{App, Arg, ArgGroup, ArgMatches, SubCommand, AppSettings}; +use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, SubCommand}; use dirs; use crate::templates; @@ -10,24 +10,24 @@ const NAME: &str = "cargo-eval"; #[inline(always)] const fn name() -> &'static str { - NAME + NAME } #[inline(always)] fn subcommand_name() -> &'static str { - &name()[6..] + &name()[6..] } pub fn data_dir() -> Option { - Some(dirs::data_local_dir()?.join(name())) + Some(dirs::data_local_dir()?.join(name())) } pub fn cache_dir() -> Option { - Some(dirs::cache_dir()?.join(name())) + Some(dirs::cache_dir()?.join(name())) } fn app() -> App<'static, 'static> { - let mut app = SubCommand::with_name(subcommand_name()) + let mut app = SubCommand::with_name(subcommand_name()) .version(env!("CARGO_PKG_VERSION")) .about("Compiles and runs “Cargoified Rust scripts”.") .usage("cargo eval [FLAGS OPTIONS] [--]