summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:38:49 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:40 +0200
commit6b4c716388ef94fcfc0e0b43404edcb4eb0e0de8 (patch)
tree52052f1aa7abc28d5ac94c9c49f9cb9b741d14a0 /bin
parent60fe1136594391480d30e825c53c4c01d8f46a41 (diff)
[Auto] bin/core/imag: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin')
-rw-r--r--bin/core/imag/src/main.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/bin/core/imag/src/main.rs b/bin/core/imag/src/main.rs
index ccc05c98..c94ac0ed 100644
--- a/bin/core/imag/src/main.rs
+++ b/bin/core/imag/src/main.rs
@@ -111,14 +111,14 @@ fn help_text(cmds: Vec<String>) -> String {
fn get_commands(out: &mut Stdout) -> Vec<String> {
let mut v = match env::var("PATH") {
Err(e) => {
- let _ = writeln!(out, "PATH error: {:?}", e)
+ writeln!(out, "PATH error: {:?}", e)
.to_exit_code()
.unwrap_or_exit();
exit(1)
},
Ok(path) => path
- .split(":")
+ .split(':')
.flat_map(|elem| {
WalkDir::new(elem)
.max_depth(1)
@@ -131,7 +131,7 @@ fn get_commands(out: &mut Stdout) -> Vec<String> {
.filter_map(|path| path
.file_name()
.to_str()
- .and_then(|s| s.splitn(2, "-").nth(1).map(String::from))
+ .and_then(|s| s.splitn(2, '-').nth(1).map(String::from))
)
})
.filter(|path| if cfg!(debug_assertions) {
@@ -185,7 +185,7 @@ fn main() {
{
let print_help = app.clone().get_matches().subcommand_name().map(|h| h == "help").unwrap_or(false);
if print_help {
- let _ = writeln!(out, "{}", long_help)
+ writeln!(out, "{}", long_help)
.to_exit_code()
.unwrap_or_exit();
exit(0)
@@ -220,7 +220,7 @@ fn main() {
if matches.is_present("version") {
debug!("Showing version");
- let _ = writeln!(out, "imag {}", env!("CARGO_PKG_VERSION"))
+ writeln!(out, "imag {}", env!("CARGO_PKG_VERSION"))
.to_exit_code()
.unwrap_or_exit();
exit(0);
@@ -248,7 +248,7 @@ fn main() {
})
.fold((), |_, line| {
// The amount of newlines may differ depending on the subprocess
- let _ = writeln!(out, "{}", line.trim())
+ writeln!(out, "{}", line.trim())
.to_exit_code()
.unwrap_or_exit();
});
@@ -259,11 +259,11 @@ fn main() {
let aliases = match fetch_aliases(config.as_ref()) {
Ok(aliases) => aliases,
Err(e) => {
- let _ = writeln!(out, "Error while fetching aliases from configuration file")
+ writeln!(out, "Error while fetching aliases from configuration file")
.to_exit_code()
.unwrap_or_exit();
debug!("Error = {:?}", e);
- let _ = writeln!(out, "Aborting")
+ writeln!(out, "Aborting")
.to_exit_code()
.unwrap_or_exit();
exit(1);
@@ -311,22 +311,22 @@ fn main() {
debug!("Error calling the subcommand");
match e.kind() {
ErrorKind::NotFound => {
- let _ = writeln!(out, "No such command: 'imag-{}'", subcommand)
+ writeln!(out, "No such command: 'imag-{}'", subcommand)
.to_exit_code()
.unwrap_or_exit();
- let _ = writeln!(out, "See 'imag --help' for available subcommands")
+ writeln!(out, "See 'imag --help' for available subcommands")
.to_exit_code()
.unwrap_or_exit();
exit(1);
},
ErrorKind::PermissionDenied => {
- let _ = writeln!(out, "No permission to execute: 'imag-{}'", subcommand)
+ writeln!(out, "No permission to execute: 'imag-{}'", subcommand)
.to_exit_code()
.unwrap_or_exit();
exit(1);
},
_ => {
- let _ = writeln!(out, "Error spawning: {:?}", e)
+ writeln!(out, "Error spawning: {:?}", e)
.to_exit_code()
.unwrap_or_exit();
exit(1);
@@ -391,7 +391,7 @@ fn forward_commandline_arguments(m: &ArgMatches, scmd: &mut Vec<String>) {
flag = flag, val_name = val_name, matches = m, v = v);
if m.is_present(val_name) {
- let _ = m
+ m
.value_of(val_name)
.map(|val| {
debug!("Found '{:?}' = {:?}", val_name, val);