]> git.lizzy.rs Git - rust.git/blobdiff - src/shape.rs
Make children list in-order
[rust.git] / src / shape.rs
index ab33826c028f9ca28209cf8cff240fd90ee185ba..12a911a19315a583d9a62e733758567725cf7ad9 100644 (file)
@@ -274,6 +274,12 @@ pub fn comment(&self, config: &Config) -> Shape {
         );
         Shape { width, ..*self }
     }
+
+    pub fn to_string_with_newline(&self, config: &Config) -> Cow<'static, str> {
+        let mut offset_indent = self.indent;
+        offset_indent.alignment = self.offset;
+        offset_indent.to_string_inner(config, 0)
+    }
 }
 
 #[cfg(test)]