Avoid bypassing setter checks by making fn.params.skip private

This commit is contained in:
J Henry Waugh
2020-08-27 23:08:34 -05:00
parent fedc4c5338
commit 62dc142c58
3 changed files with 20 additions and 12 deletions

View File

@@ -111,7 +111,7 @@ pub(crate) struct ExportedFn {
signature: syn::Signature,
is_public: bool,
mut_receiver: bool,
pub params: ExportedFnParams,
params: ExportedFnParams,
}
impl Parse for ExportedFn {
@@ -218,6 +218,14 @@ impl Parse for ExportedFn {
}
impl ExportedFn {
pub(crate) fn params(&self) -> &ExportedFnParams {
&self.params
}
pub(crate) fn skipped(&self) -> bool {
self.params.skip
}
pub(crate) fn mutable_receiver(&self) -> bool {
self.mut_receiver
}