Skip to content

Commit b333e79

Browse files
committed
Ignore unrecognized forms of #[doc ...]
Closes #2.
1 parent 2f82881 commit b333e79

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

example/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub mod module {
3333
//! ```
3434
}
3535

36+
#[doc(cfg(feature = "xxx"))]
3637
#[cfg_attr(doc, svgbobdoc::transform)]
3738
/// Some function.
3839
///

src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ impl MaybeDocAttr {
100100
Err(Error::new(nv.lit.span(), "doc comment must be a string"))
101101
}
102102
} else {
103-
Err(Error::new(
104-
meta.span(),
105-
"doc comment must be a name-value attribute",
106-
))
103+
// Ignore unrecognized form
104+
Ok(MaybeDocAttr::Other(attr))
107105
}
108106
} else {
109107
Ok(MaybeDocAttr::Other(attr))

0 commit comments

Comments
 (0)