From e8d1221a5f536d1d05d2bbaf176ec8e1cdc55295 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 20 Apr 2019 11:21:28 +0200 Subject: Text interpolation --- dhall_core/src/text.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dhall_core') diff --git a/dhall_core/src/text.rs b/dhall_core/src/text.rs index e886659..ff5c441 100644 --- a/dhall_core/src/text.rs +++ b/dhall_core/src/text.rs @@ -86,7 +86,7 @@ impl InterpolatedText { } } -impl<'a, SubExpr: 'a> FromIterator> +impl FromIterator> for InterpolatedText { fn from_iter(iter: T) -> Self @@ -94,15 +94,15 @@ impl<'a, SubExpr: 'a> FromIterator> T: IntoIterator>, { let mut res = InterpolatedText { - head: "".to_owned(), - tail: vec![], + head: String::new(), + tail: Vec::new(), }; let mut crnt_str = &mut res.head; for x in iter.into_iter() { match x { InterpolatedTextContents::Text(s) => crnt_str.push_str(&s), InterpolatedTextContents::Expr(e) => { - res.tail.push((e, "".to_owned())); + res.tail.push((e, String::new())); crnt_str = &mut res.tail.last_mut().unwrap().1; } } -- cgit v1.2.3