commit | 0bdb055b5e8e5ca0044c6bfe77242a02f816ee76 | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Wed Dec 27 21:31:51 2017 -0500 |
committer | David Tolnay <dtolnay@gmail.com> | Wed Dec 27 21:59:15 2017 -0500 |
tree | 91481587c02dded7068faea90dff2761f02399b2 | |
parent | 57292dab6888d4208753cae35cef676639f1a658 [diff] [blame] |
Use the span of variadic ... as the span of trailing comma
diff --git a/src/token.rs b/src/token.rs index cfff6f6..8c2f2d0 100644 --- a/src/token.rs +++ b/src/token.rs
@@ -32,6 +32,12 @@ #[$doc] pub struct $name(pub [Span; $len]); + impl $name { + pub fn new(span: Span) -> Self { + $name([span; $len]) + } + } + #[cfg(feature = "extra-traits")] impl ::std::fmt::Debug for $name { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {