Skip to content

Commit 08a75e8

Browse files
committed
---
yaml --- r: 13805 b: refs/heads/try c: 87c3a5c h: refs/heads/master i: 13803: 8087f6a v: v3
1 parent b2f440e commit 08a75e8

File tree

2 files changed

+17
-54
lines changed

2 files changed

+17
-54
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 259ea4e4b49cfe00efdb39e0226211a71807ec76
5+
refs/heads/try: 87c3a5c1a3e2daee39afb60be83133bf4caf4413
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustdoc/attr_parser.rs

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,12 @@ fn should_not_extract_crate_name_if_no_name_value_in_link_attribute() {
125125
assert attrs.name == none;
126126
}
127127

128-
fn parse_mod(attrs: [ast::attribute]) -> mod_attrs {
128+
fn parse_basic(
129+
attrs: [ast::attribute]
130+
) -> {
131+
brief: option<str>,
132+
desc: option<str>
133+
} {
129134
parse_short_doc_or(
130135
attrs,
131136
{|desc|
@@ -134,19 +139,17 @@ fn parse_mod(attrs: [ast::attribute]) -> mod_attrs {
134139
desc: desc
135140
}
136141
},
137-
parse_mod_long_doc
142+
{|_items, brief, desc|
143+
{
144+
brief: brief,
145+
desc: desc
146+
}
147+
}
138148
)
139149
}
140150

141-
fn parse_mod_long_doc(
142-
_items: [@ast::meta_item],
143-
brief: option<str>,
144-
desc: option<str>
145-
) -> mod_attrs {
146-
{
147-
brief: brief,
148-
desc: desc
149-
}
151+
fn parse_mod(attrs: [ast::attribute]) -> mod_attrs {
152+
parse_basic(attrs)
150153
}
151154

152155
#[test]
@@ -327,27 +330,7 @@ fn parse_fn_should_parse_failure_conditions() {
327330
}
328331

329332
fn parse_const(attrs: [ast::attribute]) -> const_attrs {
330-
parse_short_doc_or(
331-
attrs,
332-
{|desc|
333-
{
334-
brief: none,
335-
desc: desc
336-
}
337-
},
338-
parse_const_long_doc
339-
)
340-
}
341-
342-
fn parse_const_long_doc(
343-
_items: [@ast::meta_item],
344-
brief: option<str>,
345-
desc: option<str>
346-
) -> const_attrs {
347-
{
348-
brief: brief,
349-
desc: desc
350-
}
333+
parse_basic(attrs)
351334
}
352335

353336
#[test]
@@ -368,27 +351,7 @@ fn should_parse_const_long_doc() {
368351
}
369352

370353
fn parse_enum(attrs: [ast::attribute]) -> enum_attrs {
371-
parse_short_doc_or(
372-
attrs,
373-
{|desc|
374-
{
375-
brief: none,
376-
desc: desc
377-
}
378-
},
379-
parse_enum_long_doc
380-
)
381-
}
382-
383-
fn parse_enum_long_doc(
384-
_items: [@ast::meta_item],
385-
brief: option<str>,
386-
desc: option<str>
387-
) -> enum_attrs {
388-
{
389-
brief: brief,
390-
desc: desc
391-
}
354+
parse_basic(attrs)
392355
}
393356

394357
#[test]

0 commit comments

Comments
 (0)