From 94023098bdadd38fcae6801048c8565efa893f59 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 14 Mar 2019 21:59:33 +0100 Subject: rustfmt --- dhall_core/src/core.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index 8ce9715..ea23cbd 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -213,11 +213,17 @@ pub enum BorrowedInterpolatedTextContents<'a, Note, Embed> { Expr(&'a Expr), } -impl<'a, N: Clone + 'a, E: Clone + 'a> BorrowedInterpolatedTextContents<'a, N, E> { +impl<'a, N: Clone + 'a, E: Clone + 'a> + BorrowedInterpolatedTextContents<'a, N, E> +{ pub fn to_owned(self) -> OwnedInterpolatedTextContents<'a, N, E> { match self { - BorrowedInterpolatedTextContents::Text(s) => OwnedInterpolatedTextContents::Text(s), - BorrowedInterpolatedTextContents::Expr(e) => OwnedInterpolatedTextContents::Expr(e.clone()), + BorrowedInterpolatedTextContents::Text(s) => { + OwnedInterpolatedTextContents::Text(s) + } + BorrowedInterpolatedTextContents::Expr(e) => { + OwnedInterpolatedTextContents::Expr(e.clone()) + } } } } @@ -233,7 +239,9 @@ impl InterpolatedText { } } - pub fn iter(&self) -> impl Iterator> { + pub fn iter( + &self, + ) -> impl Iterator> { use std::iter::once; once(BorrowedInterpolatedTextContents::Text(self.head.as_ref())).chain( self.tail.iter().flat_map(|(e, s)| { @@ -275,7 +283,10 @@ impl<'a, N: Clone + 'a, E: Clone + 'a> impl Add for InterpolatedText { type Output = InterpolatedText; fn add(self, rhs: InterpolatedText) -> Self::Output { - self.iter().chain(rhs.iter()).map(BorrowedInterpolatedTextContents::to_owned).collect() + self.iter() + .chain(rhs.iter()) + .map(BorrowedInterpolatedTextContents::to_owned) + .collect() } } -- cgit v1.2.3