From 20a0736acda86a4209aa8726784b0a33306cd9a7 Mon Sep 17 00:00:00 2001 From: nabijaczleweli Date: Wed, 12 Oct 2016 01:19:25 +0200 Subject: [PATCH] Take FnOnce() instead of Fn() in terminal::with_*() --- src/terminal/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/terminal/mod.rs b/src/terminal/mod.rs index eaef19ff..5979063d 100644 --- a/src/terminal/mod.rs +++ b/src/terminal/mod.rs @@ -85,7 +85,7 @@ pub fn set_foreground(color: Color) { } /// Sets the foreground color before calling the function and resets it afterwards. -pub fn with_foreground(color: Color, callback: F) { +pub fn with_foreground(color: Color, callback: F) { let current = ffi::state_color(ffi::TK_COLOR); set_foreground(color); callback(); @@ -100,7 +100,7 @@ pub fn set_background(color: Color) { } /// Sets the background color before calling the function and resets it afterwards. -pub fn with_background(color: Color, callback: F) { +pub fn with_background(color: Color, callback: F) { let current = ffi::state_color(ffi::TK_BKCOLOR); set_background(color); callback(); @@ -116,7 +116,7 @@ pub fn set_colors(fg: Color, bg: Color) { } /// Sets the foreground and background color before calling the function and resets them afterwards. -pub fn with_colors(fg: Color, bg: Color, callback: F) { +pub fn with_colors(fg: Color, bg: Color, callback: F) { with_foreground(fg, || with_background(bg, || callback()