Merge pull request #38 from night-cruise/fix/update-impl-builder-methods

Update the impl_builder_methods macro to let all chain methods in a s…
This commit is contained in:
Dongri Jin
2023-10-19 11:37:17 +09:00
committed by GitHub

View File

@ -10,13 +10,13 @@ pub struct Usage {
#[macro_export]
macro_rules! impl_builder_methods {
($builder:ident, $($field:ident: $field_type:ty),*) => {
$(
impl $builder {
impl $builder {
$(
pub fn $field(mut self, $field: $field_type) -> Self {
self.$field = Some($field);
self
}
}
)*
)*
}
};
}