about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-12-03 22:20:53 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-12-04 13:13:59 +0100
commitf5e0d0cc18c4450fa0d8cbe0802154c392eb4570 (patch)
tree2d2f20b1b853ed9785d1815a45ea6d95b5eaf950
parent91e021a59cecb995a8fdf492d55031d8cfca00f5 (diff)
downloadrust-f5e0d0cc18c4450fa0d8cbe0802154c392eb4570.tar.gz
rust-f5e0d0cc18c4450fa0d8cbe0802154c392eb4570.zip
Make some formatting improvements
-rw-r--r--src/librustdoc/clean/types.rs15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index 907b96e964a..1880824571a 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -1,5 +1,3 @@
-// ignore-tidy-filelength
-
 use std::fmt;
 use std::hash::{Hash, Hasher};
 use std::default::Default;
@@ -88,7 +86,6 @@ pub struct Item {
 
 impl fmt::Debug for Item {
     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
-
         let fake = MAX_DEF_ID.with(|m| m.borrow().get(&self.def_id.krate)
                                    .map(|id| self.def_id >= *id).unwrap_or(false));
         let def_id: &dyn fmt::Debug = if fake { &"**FAKE**" } else { &self.def_id };
@@ -112,6 +109,7 @@ impl Item {
     pub fn doc_value(&self) -> Option<&str> {
         self.attrs.doc_value()
     }
+
     /// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
     /// with newlines.
     pub fn collapsed_doc_value(&self) -> Option<String> {
@@ -174,7 +172,6 @@ impl Item {
     pub fn is_keyword(&self) -> bool {
         self.type_() == ItemType::Keyword
     }
-
     pub fn is_stripped(&self) -> bool {
         match self.inner { StrippedItem(..) => true, _ => false }
     }
@@ -456,9 +453,7 @@ impl Attributes {
     /// Reads a `MetaItem` from within an attribute, looks for whether it is a
     /// `#[doc(include="file")]`, and returns the filename and contents of the file as loaded from
     /// its expansion.
-    pub fn extract_include(mi: &ast::MetaItem)
-        -> Option<(String, String)>
-    {
+    pub fn extract_include(mi: &ast::MetaItem) -> Option<(String, String)> {
         mi.meta_item_list().and_then(|list| {
             for meta in list {
                 if meta.check_name(sym::include) {
@@ -508,8 +503,7 @@ impl Attributes {
         false
     }
 
-    pub fn from_ast(diagnostic: &::errors::Handler,
-                    attrs: &[ast::Attribute]) -> Attributes {
+    pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
         let mut doc_strings = vec![];
         let mut sp = None;
         let mut cfg = Cfg::True;
@@ -520,7 +514,7 @@ impl Attributes {
         /// returns `attr` unchanged.
         pub fn with_doc_comment_markers_stripped<T>(
             attr: &Attribute,
-            f: impl FnOnce(&Attribute) -> T
+            f: impl FnOnce(&Attribute) -> T,
         ) -> T {
             match attr.kind {
                 AttrKind::Normal(_) => {
@@ -823,7 +817,6 @@ impl GenericParamDefKind {
 #[derive(Clone, PartialEq, Eq, Debug, Hash)]
 pub struct GenericParamDef {
     pub name: String,
-
     pub kind: GenericParamDefKind,
 }