Skip to content

Commit

Permalink
Clarify argument documentation in report_body_field_accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-mobilecoin committed Mar 2, 2023
1 parent 63a7d84 commit 85c74d4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions verifier/src/report_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@ pub trait Accessor<T>: Debug {
fn get(&self) -> T;
}

/// Macro to generate boilerplate for implementing [`Accessor`] for a member of
/// Macro to generate boilerplate for implementing [`Accessor`] for a field of
/// [`ReportBody`].
///
/// Will create [`Accessor`] implementations for both `ReportBody` and the
/// underlying member type
/// underlying field type
///
/// # Arguments
/// * `member_type` - The type of the member
/// * `accessor_method` - The method on `ReportBody` that returns the member
macro_rules! report_body_member_accessors {
($($member_type:ty, $accessor_method:ident;)*) => {$(
impl Accessor<$member_type> for ReportBody {
fn get(&self) -> $member_type {
/// * `field_type` - The type of the field in `ReportBody` to be accessed
/// * `accessor_method` - The method on `ReportBody` that returns the field
macro_rules! report_body_field_accessors {
($($field_type:ty, $accessor_method:ident;)*) => {$(
impl Accessor<$field_type> for ReportBody {
fn get(&self) -> $field_type {
self.$accessor_method()
}
}

impl Accessor<$member_type> for $member_type {
fn get(&self) -> $member_type {
impl Accessor<$field_type> for $field_type {
fn get(&self) -> $field_type {
self.clone()
}
}
)*}
}

report_body_member_accessors! {
report_body_field_accessors! {
Attributes, attributes;
ConfigId, config_id;
ConfigSvn, config_svn;
Expand Down

0 comments on commit 85c74d4

Please sign in to comment.