From db48d109e7dcbd359233d63836e9874c59766527 Mon Sep 17 00:00:00 2001 From: Arcterus Date: Wed, 3 Dec 2014 10:12:43 -0800 Subject: [PATCH] Use -O instead of --opt-level 3 (closes #194) --- Makefile | 2 +- src/rm/rm.rs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index bc7916abe..7a507b4c6 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ TESTDIR := $(BASEDIR)/test TEMPDIR := $(BASEDIR)/tmp # Flags -RUSTCFLAGS := --opt-level=3 -L $(BUILDDIR)/ +RUSTCFLAGS := -O -L $(BUILDDIR)/ RMFLAGS := # Handle config setup diff --git a/src/rm/rm.rs b/src/rm/rm.rs index c157f4016..6fdc7916b 100644 --- a/src/rm/rm.rs +++ b/src/rm/rm.rs @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -#![feature(macro_rules)] +#![feature(if_let, macro_rules)] extern crate getopts; extern crate libc; @@ -114,10 +114,9 @@ pub fn uumain(args: Vec) -> int { return 0; } } - match remove(matches.free, force, interactive, one_fs, preserve_root, - recursive, dir, verbose) { - Ok(()) => ( /* pass */ ), - Err(e) => return e + if let Err(e) = remove(matches.free, force, interactive, one_fs, preserve_root, + recursive, dir, verbose) { + return e; } }