]> git.lizzy.rs Git - rust.git/blobdiff - src/lists.rs
Format source codes
[rust.git] / src / lists.rs
index c770d1bf9539e7ee3125e6d63150c4ca47206c3c..da412211233772a91589be54ea85075a38336331 100644 (file)
@@ -132,9 +132,10 @@ pub fn is_multiline(&self) -> bool {
     }
 
     pub fn has_line_pre_comment(&self) -> bool {
-        self.pre_comment
-            .as_ref()
-            .map_or(false, |comment| comment.starts_with("//"))
+        self.pre_comment.as_ref().map_or(
+            false,
+            |comment| comment.starts_with("//"),
+        )
     }
 
     pub fn from_str<S: Into<String>>(s: S) -> ListItem {
@@ -419,10 +420,9 @@ fn next(&mut self) -> Option<Self::Item> {
                     }
                 }
                 None => {
-                    post_snippet.find_uncommented(self.terminator).unwrap_or(
-                        post_snippet
-                            .len(),
-                    )
+                    post_snippet
+                        .find_uncommented(self.terminator)
+                        .unwrap_or(post_snippet.len())
                 }
             };
 
@@ -435,10 +435,9 @@ fn next(&mut self) -> Option<Self::Item> {
                 let first_newline = test_snippet.find('\n').unwrap_or(test_snippet.len());
                 // From the end of the first line of comments.
                 let test_snippet = &test_snippet[first_newline..];
-                let first = test_snippet.find(|c: char| !c.is_whitespace()).unwrap_or(
-                    test_snippet
-                        .len(),
-                );
+                let first = test_snippet
+                    .find(|c: char| !c.is_whitespace())
+                    .unwrap_or(test_snippet.len());
                 // From the end of the first line of comments to the next non-whitespace char.
                 let test_snippet = &test_snippet[..first];