From a49552225928b8dcfef96c39764abbe7b5404dd5 Mon Sep 17 00:00:00 2001
From: Chris Wong <lambda.fairy@gmail.com>
Date: Fri, 7 Aug 2020 21:24:00 +1000
Subject: [PATCH] Put specialized impls in a logical order (#205)

Follow-up to #204

cc @berwyn
---
 maud/src/lib.rs | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/maud/src/lib.rs b/maud/src/lib.rs
index 52223b7..02e1386 100644
--- a/maud/src/lib.rs
+++ b/maud/src/lib.rs
@@ -76,16 +76,17 @@ pub trait Render {
     }
 }
 
-#[cfg(feature = "unstable")]
+#[cfg(not(feature = "unstable"))]
 impl<T: fmt::Display + ?Sized> Render for T {
-    default fn render_to(&self, w: &mut String) {
+    fn render_to(&self, w: &mut String) {
         let _ = write!(Escaper::new(w), "{}", self);
     }
 }
 
-impl<T: AsRef<str>> Render for PreEscaped<T> {
-    fn render_to(&self, w: &mut String) {
-        w.push_str(self.0.as_ref());
+#[cfg(feature = "unstable")]
+impl<T: fmt::Display + ?Sized> Render for T {
+    default fn render_to(&self, w: &mut String) {
+        let _ = write!(Escaper::new(w), "{}", self);
     }
 }
 
@@ -103,17 +104,16 @@ impl Render for str {
     }
 }
 
-#[cfg(not(feature = "unstable"))]
-impl<T: fmt::Display + ?Sized> Render for T {
-    fn render_to(&self, w: &mut String) {
-        let _ = write!(Escaper::new(w), "{}", self);
-    }
-}
-
 /// A wrapper that renders the inner value without escaping.
 #[derive(Debug, Clone, Copy)]
 pub struct PreEscaped<T: AsRef<str>>(pub T);
 
+impl<T: AsRef<str>> Render for PreEscaped<T> {
+    fn render_to(&self, w: &mut String) {
+        w.push_str(self.0.as_ref());
+    }
+}
+
 /// A block of markup is a string that does not need to be escaped.
 ///
 /// The `html!` macro expands to an expression of this type.