From 1d7e54c9a4ce8da011db9874555e222e74392da3 Mon Sep 17 00:00:00 2001 From: KokaKiwi Date: Fri, 27 Mar 2015 00:10:38 +0100 Subject: [PATCH] Replace function pointers with direct calls. --- src/lib.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5eef212..6d5fa42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -183,13 +183,19 @@ impl Config { } fn compiler(&self, target: &str) -> String { - let compiler_fn: fn(&str) -> String = if self.cpp { gxx } else { gcc }; - compiler_fn(target) + if self.cpp { + gxx(target) + } else { + gcc(target) + } } fn compile_flags(&self) -> Vec { - let flags_fn: fn() -> Vec = if self.cpp { cxxflags } else { cflags }; - flags_fn() + if self.cpp { + cxxflags() + } else { + cflags() + } } fn compile_cmd(&self) -> Command {