From 4d41695df446d9a2d328f7bb496743d5a2ee2c58 Mon Sep 17 00:00:00 2001 From: Georgi Dimitrov Date: Thu, 7 Jul 2016 15:00:19 -0700 Subject: [PATCH] Fix deprecation warning and broken import - fix use of std.conv.to which was not imported in the file - added a local import - tested that the mixed in code compiles --- src/temple/func_string_gen.d | 3 ++- src/temple/package.d | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/temple/func_string_gen.d b/src/temple/func_string_gen.d index 7b5f869..298a4cc 100644 --- a/src/temple/func_string_gen.d +++ b/src/temple/func_string_gen.d @@ -420,7 +420,8 @@ string build_function_head(string filter_ident) { ret ~= ` void __temple_buff_filtered_put(T)(T thing) { - __temple_context.put(.std.conv.to!string(thing)); + import std.conv : to; + __temple_context.put(to!string(thing)); } /// without filter, render subtemplate with an explicit context (which defaults to null) diff --git a/src/temple/package.d b/src/temple/package.d index b38e58a..6d0a2d3 100644 --- a/src/temple/package.d +++ b/src/temple/package.d @@ -26,6 +26,7 @@ private import private import std.array : appender, Appender; private import std.range : isOutputRange; private import std.typecons : scoped; +private import std.stdio : File; public { import temple.temple_context : TempleContext; @@ -165,7 +166,7 @@ public: void render(void function(string) sink, TempleContext tc = null) const { auto oc = TempleOutputStream(sink); this.render(oc, tc); } - void render(ref std.stdio.File f, TempleContext tc = null) const { + void render(ref File f, TempleContext tc = null) const { auto oc = TempleOutputStream(f); this.render(oc, tc); }