File tree Expand file tree Collapse file tree 9 files changed +76
-28
lines changed Expand file tree Collapse file tree 9 files changed +76
-28
lines changed Original file line number Diff line number Diff line change @@ -252,41 +252,25 @@ impl SynAttributeHelpers for [syn::Attribute] {
252
252
}
253
253
254
254
fn get_comment_lines ( & self ) -> Vec < String > {
255
- let mut raw_comment = String :: new ( ) ;
255
+ let mut comment = Vec :: new ( ) ;
256
256
257
257
for attr in self {
258
258
if attr. style == syn:: AttrStyle :: Outer {
259
259
if let Some ( syn:: Meta :: NameValue ( syn:: MetaNameValue {
260
260
ident,
261
- lit : syn:: Lit :: Str ( comment ) ,
261
+ lit : syn:: Lit :: Str ( content ) ,
262
262
..
263
263
} ) ) = attr. interpret_meta ( )
264
264
{
265
265
let name = ident. to_string ( ) ;
266
266
if & * name == "doc" {
267
- let text = comment. value ( ) ;
268
- raw_comment += & text;
269
- raw_comment += "\n " ;
267
+ let text = content. value ( ) . trim ( ) . to_owned ( ) ;
268
+ comment. push ( text) ;
270
269
}
271
270
}
272
271
}
273
272
}
274
273
275
- let mut comment_lines = Vec :: new ( ) ;
276
- for raw in raw_comment. lines ( ) {
277
- let line = raw
278
- . trim_start_matches ( " " )
279
- . trim_start_matches ( "//" )
280
- . trim_start_matches ( "///" )
281
- . trim_start_matches ( "/**" )
282
- . trim_start_matches ( "/*" )
283
- . trim_start_matches ( "*/" )
284
- . trim_start_matches ( "*" )
285
- . trim_end ( ) ;
286
-
287
- comment_lines. push ( line. to_owned ( ) ) ;
288
- }
289
-
290
- comment_lines
274
+ comment
291
275
}
292
276
}
Original file line number Diff line number Diff line change 12
12
* # Hint
13
13
*
14
14
* Always ensure that everything is properly documented, even if you feel lazy.
15
- * Sometimes** it is also helpful to include some markdown formatting.
15
+ * **Sometimes** it is also helpful to include some markdown formatting.
16
+ *
17
+ * ////////////////////////////////////////////////////////////////////////////
18
+ *
19
+ * # Attention
20
+ *
21
+ * Rust is going to trim all leading `/` symbols. If you want to use them as a
22
+ * marker you need to add at least a single whitespace inbetween the tripple
23
+ * slash doc-comment marker and the rest.
16
24
*/
17
25
void root (void );
Original file line number Diff line number Diff line change @@ -16,7 +16,15 @@ extern "C" {
16
16
* # Hint
17
17
*
18
18
* Always ensure that everything is properly documented, even if you feel lazy.
19
- * Sometimes** it is also helpful to include some markdown formatting.
19
+ * **Sometimes** it is also helpful to include some markdown formatting.
20
+ *
21
+ * ////////////////////////////////////////////////////////////////////////////
22
+ *
23
+ * # Attention
24
+ *
25
+ * Rust is going to trim all leading `/` symbols. If you want to use them as a
26
+ * marker you need to add at least a single whitespace inbetween the tripple
27
+ * slash doc-comment marker and the rest.
20
28
*/
21
29
void root (void );
22
30
Original file line number Diff line number Diff line change 12
12
* # Hint
13
13
*
14
14
* Always ensure that everything is properly documented, even if you feel lazy.
15
- * Sometimes** it is also helpful to include some markdown formatting.
15
+ * **Sometimes** it is also helpful to include some markdown formatting.
16
+ *
17
+ * ////////////////////////////////////////////////////////////////////////////
18
+ *
19
+ * # Attention
20
+ *
21
+ * Rust is going to trim all leading `/` symbols. If you want to use them as a
22
+ * marker you need to add at least a single whitespace inbetween the tripple
23
+ * slash doc-comment marker and the rest.
16
24
*/
17
25
void root (void );
Original file line number Diff line number Diff line change @@ -16,7 +16,15 @@ extern "C" {
16
16
* # Hint
17
17
*
18
18
* Always ensure that everything is properly documented, even if you feel lazy.
19
- * Sometimes** it is also helpful to include some markdown formatting.
19
+ * **Sometimes** it is also helpful to include some markdown formatting.
20
+ *
21
+ * ////////////////////////////////////////////////////////////////////////////
22
+ *
23
+ * # Attention
24
+ *
25
+ * Rust is going to trim all leading `/` symbols. If you want to use them as a
26
+ * marker you need to add at least a single whitespace inbetween the tripple
27
+ * slash doc-comment marker and the rest.
20
28
*/
21
29
void root (void );
22
30
Original file line number Diff line number Diff line change @@ -13,7 +13,15 @@ extern "C" {
13
13
// / # Hint
14
14
// /
15
15
// / Always ensure that everything is properly documented, even if you feel lazy.
16
- // / Sometimes** it is also helpful to include some markdown formatting.
16
+ // / **Sometimes** it is also helpful to include some markdown formatting.
17
+ // /
18
+ // / ////////////////////////////////////////////////////////////////////////////
19
+ // /
20
+ // / # Attention
21
+ // /
22
+ // / Rust is going to trim all leading `/` symbols. If you want to use them as a
23
+ // / marker you need to add at least a single whitespace inbetween the tripple
24
+ // / slash doc-comment marker and the rest.
17
25
void root ();
18
26
19
27
} // extern "C"
Original file line number Diff line number Diff line change 12
12
* # Hint
13
13
*
14
14
* Always ensure that everything is properly documented, even if you feel lazy.
15
- * Sometimes** it is also helpful to include some markdown formatting.
15
+ * **Sometimes** it is also helpful to include some markdown formatting.
16
+ *
17
+ * ////////////////////////////////////////////////////////////////////////////
18
+ *
19
+ * # Attention
20
+ *
21
+ * Rust is going to trim all leading `/` symbols. If you want to use them as a
22
+ * marker you need to add at least a single whitespace inbetween the tripple
23
+ * slash doc-comment marker and the rest.
16
24
*/
17
25
void root (void );
Original file line number Diff line number Diff line change @@ -16,7 +16,15 @@ extern "C" {
16
16
* # Hint
17
17
*
18
18
* Always ensure that everything is properly documented, even if you feel lazy.
19
- * Sometimes** it is also helpful to include some markdown formatting.
19
+ * **Sometimes** it is also helpful to include some markdown formatting.
20
+ *
21
+ * ////////////////////////////////////////////////////////////////////////////
22
+ *
23
+ * # Attention
24
+ *
25
+ * Rust is going to trim all leading `/` symbols. If you want to use them as a
26
+ * marker you need to add at least a single whitespace inbetween the tripple
27
+ * slash doc-comment marker and the rest.
20
28
*/
21
29
void root (void );
22
30
Original file line number Diff line number Diff line change 7
7
///
8
8
/// Always ensure that everything is properly documented, even if you feel lazy.
9
9
/// **Sometimes** it is also helpful to include some markdown formatting.
10
+ ///
11
+ /// ////////////////////////////////////////////////////////////////////////////
12
+ ///
13
+ /// # Attention
14
+ ///
15
+ /// Rust is going to trim all leading `/` symbols. If you want to use them as a
16
+ /// marker you need to add at least a single whitespace inbetween the tripple
17
+ /// slash doc-comment marker and the rest.
10
18
#[ no_mangle]
11
19
pub extern "C" fn root ( ) {
12
20
}
You can’t perform that action at this time.
0 commit comments