@@ -120,7 +120,7 @@ impl App {
120120
121121 // Read arguments from bats config file
122122 let mut args = get_args_from_env_var()
123− .unwrap_or_else(|| get_args_from_config_file())
123+ .unwrap_or_else(get_args_from_config_file)
124124 .chain_err(|| "Could not parse configuration file")?;
125125
126126 // Put the zero-th CLI argument (program name) first
@@ -152,12 +152,10 @@ impl App {
152152 } else {
153153 PagingMode::Never
154154 }
155+ } else if self.interactive_output {
156+ PagingMode::QuitIfOneScreen
155157 } else {
156− if self.interactive_output {
157− PagingMode::QuitIfOneScreen
158− } else {
159− PagingMode::Never
160− }
158+ PagingMode::Never
161159 }
162160 }
163161 };
@@ -166,7 +164,7 @@ impl App {
166164
167165 if let Some(values) = self.matches.values_of("map-syntax") {
168166 for from_to in values {
169− let parts: Vec<_> = from_to.split(":").collect();
167+ let parts: Vec<_> = from_to.split(':').collect();
170168
171169 if parts.len() != 2 {
172170 return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is 'from:to'.".into());
@@ -213,11 +211,11 @@ impl App {
213211 .matches
214212 .value_of("terminal-width")
215213 .and_then(|w| {
216− if w.starts_with("+") || w.starts_with("-") {
214+ if w.starts_with('+') || w.starts_with('-') {
217215 // Treat argument as a delta to the current terminal width
218216 w.parse().ok().map(|delta: i16| {
219217 let old_width: u16 = Term::stdout().size().1;
220− let new_width: i32 = old_width as i32 + delta as i32;
218+ let new_width: i32 = i32::from(old_width) + i32::from(delta);
221219
222220 if new_width <= 0 {
223221 old_width as usize
@@ -252,14 +250,14 @@ impl App {
252250 .value_of("theme")
253251 .map(String::from)
254252 .or_else(|| env::var("BAT_THEME").ok())
255− .unwrap_or(String::from(BAT_THEME_DEFAULT)),
253+ .unwrap_or_else(|| String::from(BAT_THEME_DEFAULT)),
256254 line_ranges: LineRanges::from(
257255 transpose(
258256 self.matches
259257 .values_of("line-range")
260258 .map(|vs| vs.map(LineRange::from).collect()),
261259 )?
262− .unwrap_or(vec![]),
260+ .unwrap_or_else(|| vec![]),
263261 ),
264262 output_components,
265263 syntax_mapping,
@@ -306,7 +304,7 @@ impl App {
306304 let env_style_components: Option<Vec<OutputComponent>> =
307305 transpose(env::var("BAT_STYLE").ok().map(|style_str| {
308306 style_str
309− .split(",")
307+ .split(',')
310308 .map(|x| OutputComponent::from_str(&x))
311309 .collect::<Result<Vec<OutputComponent>>>()
312310 }))?;
@@ -315,13 +313,13 @@ impl App {
315313 .value_of("style")
316314 .map(|styles| {
317315 styles
318− .split(",")
316+ .split(',')
319317 .map(|style| style.parse::<OutputComponent>())
320318 .filter_map(|style| style.ok())
321319 .collect::<Vec<_>>()
322320 })
323321 .or(env_style_components)
324− .unwrap_or(vec![OutputComponent::Full])
322+ .unwrap_or_else(|| vec![OutputComponent::Full])
325323 .into_iter()
326324 .map(|style| style.components(self.interactive_output))
327325 .fold(HashSet::new(), |mut acc, components| {