Skip to content

Commit 338f84f

Browse files
wojciech-grajjhpratt
authored andcommitted
Allow clippy::ref_option lint for serde::format_description.
1 parent f8ecd81 commit 338f84f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

time-macros/src/quote.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ macro_rules! quote_inner {
101101
quote_inner!($ts $($tail)*);
102102
};
103103

104+
// Attribute
105+
($ts:ident #[$($inner:tt)*] $($tail:tt)*) => {
106+
$ts.extend([
107+
::proc_macro::TokenTree::from(
108+
::proc_macro::Punct::new('#', ::proc_macro::Spacing::Alone)
109+
),
110+
::proc_macro::TokenTree::Group(::proc_macro::Group::new(
111+
::proc_macro::Delimiter::Bracket,
112+
quote!($($inner)*)
113+
)),
114+
]);
115+
quote_inner!($ts $($tail)*);
116+
};
117+
104118
// Groups
105119
($ts:ident ($($inner:tt)*) $($tail:tt)*) => {
106120
$ts.extend([::proc_macro::TokenTree::Group(::proc_macro::Group::new(

time-macros/src/serde_format_description.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ pub(crate) fn build(
103103

104104
let serialize_option = if cfg!(feature = "formatting") {
105105
quote! {
106+
#[allow(clippy::ref_option)]
106107
pub fn serialize<S: ::serde::Serializer>(
107108
option: &Option<__TimeSerdeType>,
108109
serializer: S,

0 commit comments

Comments
 (0)