Skip to content

Commit f5e0d0c

Browse files
Make some formatting improvements
1 parent 91e021a commit f5e0d0c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/librustdoc/clean/types.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore-tidy-filelength
2-
31
use std::fmt;
42
use std::hash::{Hash, Hasher};
53
use std::default::Default;
@@ -88,7 +86,6 @@ pub struct Item {
8886

8987
impl fmt::Debug for Item {
9088
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
91-
9289
let fake = MAX_DEF_ID.with(|m| m.borrow().get(&self.def_id.krate)
9390
.map(|id| self.def_id >= *id).unwrap_or(false));
9491
let def_id: &dyn fmt::Debug = if fake { &"**FAKE**" } else { &self.def_id };
@@ -112,6 +109,7 @@ impl Item {
112109
pub fn doc_value(&self) -> Option<&str> {
113110
self.attrs.doc_value()
114111
}
112+
115113
/// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
116114
/// with newlines.
117115
pub fn collapsed_doc_value(&self) -> Option<String> {
@@ -174,7 +172,6 @@ impl Item {
174172
pub fn is_keyword(&self) -> bool {
175173
self.type_() == ItemType::Keyword
176174
}
177-
178175
pub fn is_stripped(&self) -> bool {
179176
match self.inner { StrippedItem(..) => true, _ => false }
180177
}
@@ -456,9 +453,7 @@ impl Attributes {
456453
/// Reads a `MetaItem` from within an attribute, looks for whether it is a
457454
/// `#[doc(include="file")]`, and returns the filename and contents of the file as loaded from
458455
/// its expansion.
459-
pub fn extract_include(mi: &ast::MetaItem)
460-
-> Option<(String, String)>
461-
{
456+
pub fn extract_include(mi: &ast::MetaItem) -> Option<(String, String)> {
462457
mi.meta_item_list().and_then(|list| {
463458
for meta in list {
464459
if meta.check_name(sym::include) {
@@ -508,8 +503,7 @@ impl Attributes {
508503
false
509504
}
510505

511-
pub fn from_ast(diagnostic: &::errors::Handler,
512-
attrs: &[ast::Attribute]) -> Attributes {
506+
pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
513507
let mut doc_strings = vec![];
514508
let mut sp = None;
515509
let mut cfg = Cfg::True;
@@ -520,7 +514,7 @@ impl Attributes {
520514
/// returns `attr` unchanged.
521515
pub fn with_doc_comment_markers_stripped<T>(
522516
attr: &Attribute,
523-
f: impl FnOnce(&Attribute) -> T
517+
f: impl FnOnce(&Attribute) -> T,
524518
) -> T {
525519
match attr.kind {
526520
AttrKind::Normal(_) => {
@@ -823,7 +817,6 @@ impl GenericParamDefKind {
823817
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
824818
pub struct GenericParamDef {
825819
pub name: String,
826-
827820
pub kind: GenericParamDefKind,
828821
}
829822

0 commit comments

Comments
 (0)