Skip to content

Commit 8dd03f2

Browse files
Clarify docs on expanded_name!()
Fixes #400
1 parent fbe0779 commit 8dd03f2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

markup5ever/interface/mod.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ impl<'a> fmt::Debug for ExpandedName<'a> {
4343

4444
/// Helper to quickly create an expanded name.
4545
///
46+
/// Can be used with no namespace as `expanded_name!("", "some_name")`
47+
/// or with a namespace as `expanded_name!(ns "some_name")`. In the
48+
/// latter case, `ns` is one of the symbols which the [`ns!`][ns]
49+
/// macro accepts; note the lack of a comma between the `ns` and
50+
/// `"some_name"`.
51+
///
52+
/// [ns]: macro.ns.html
53+
///
4654
/// # Examples
4755
///
4856
/// ```
@@ -57,7 +65,15 @@ impl<'a> fmt::Debug for ExpandedName<'a> {
5765
/// ns: &ns!(),
5866
/// local: &local_name!("div")
5967
/// }
60-
/// )
68+
/// );
69+
///
70+
/// assert_eq!(
71+
/// expanded_name!(html "div"),
72+
/// ExpandedName {
73+
/// ns: &ns!(html),
74+
/// local: &local_name!("div")
75+
/// }
76+
/// );
6177
/// # }
6278
#[macro_export]
6379
macro_rules! expanded_name {

0 commit comments

Comments
 (0)