- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3
          Add measurement-set command
          #316
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| This PR came up while I was doing some debugging for manufacturing programming and I figure if I wanted it once we will probably want it again | 
It's useful to see what the current set of measurements is on device
ac70b56    to
    9c4ad21      
    Compare
  
    |  | ||
| impl std::iter::IntoIterator for MeasurementSet { | ||
| type Item = Measurement; | ||
| type IntoIter = <std::collections::HashSet<attest_data::Measurement> as std::iter::IntoIterator>::IntoIter; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what rust suggested, it's possible I could do this in a less obfuscated way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way is to define an Iterator for MeasurementSet and then impl IntoIterator in terms of that. This seems fine though, and is less code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HashSet is already in scope here so you save some characters by dropping the std::collections
| } | ||
|  | ||
| fn measurement_set(attest: &dyn Attest) -> Result<MeasurementSet> { | ||
| // get log | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably don't need this comment
|  | ||
| impl std::iter::IntoIterator for MeasurementSet { | ||
| type Item = Measurement; | ||
| type IntoIter = <std::collections::HashSet<attest_data::Measurement> as std::iter::IntoIterator>::IntoIter; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way is to define an Iterator for MeasurementSet and then impl IntoIterator in terms of that. This seems fine though, and is less code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It's useful to see what the current set of measurements is on device