From 5f944fad6687ce4f13426b7c3c04802e5e548ed3 Mon Sep 17 00:00:00 2001 From: yamadapc Date: Sat, 12 Jul 2014 19:32:26 -0300 Subject: [PATCH] Use const `str` parameters. This is a more reasonable approach. --- source/colorize.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/colorize.d b/source/colorize.d index c2549a7..4efcffd 100644 --- a/source/colorize.d +++ b/source/colorize.d @@ -83,8 +83,12 @@ static enum mode : int * --- */ -string colorize(string str, fg c=fg.init, bg b=bg.init, mode m=mode.init) - pure +string colorize( + const string str, + const fg c=fg.init, + const bg b=bg.init, + const mode m=mode.init +) pure { return format("\033[%d;%d;%dm%s\033[0m", m, c, b, str); }