The doc parameter of define_handle is now optional

This commit is contained in:
Aaron Loucks 2019-03-17 12:54:26 -04:00
parent c400af7f32
commit 584a3bb5da
2 changed files with 6 additions and 0 deletions

View file

@ -222,6 +222,9 @@ macro_rules! handle_nondispatchable {
} }
#[macro_export] #[macro_export]
macro_rules! define_handle { macro_rules! define_handle {
( $ name : ident , $ ty : ident ) => {
define_handle!($name, $ty, doc = "");
};
( $ name : ident , $ ty : ident , $ doc_link : meta ) => { ( $ name : ident , $ ty : ident , $ doc_link : meta ) => {
#[repr(transparent)] #[repr(transparent)]
#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash)] #[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash)]

View file

@ -98,6 +98,9 @@ pub fn define_handle_macro() -> Tokens {
quote! { quote! {
#[macro_export] #[macro_export]
macro_rules! define_handle{ macro_rules! define_handle{
($name: ident, $ty: ident) => {
define_handle!($name, $ty, doc = "");
};
($name: ident, $ty: ident, $doc_link: meta) => { ($name: ident, $ty: ident, $doc_link: meta) => {
#[repr(transparent)] #[repr(transparent)]
#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash)] #[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash)]